Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix or skip integrations tests #1628

Merged
merged 7 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MatrixSDKTests/MXNotificationCenterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ - (void)testDefaultDisplayNameCondition
}];
}

- (void)testDefaultRoomMemberCountCondition
- (void)testDefaultEventMatchCondition
{
[matrixSDKTestsData doMXSessionTestWithBobAndAliceInARoom:self readyToTest:^(MXSession *bobSession, MXRestClient *aliceRestClient, NSString *roomId, XCTestExpectation *expectation) {

Expand All @@ -288,8 +288,8 @@ - (void)testDefaultRoomMemberCountCondition
XCTAssert(rule.isDefault, @"The rule must be the server default rule. Rule: %@", rule);

MXPushRuleCondition *condition = rule.conditions[0];
XCTAssertEqualObjects(condition.kind, kMXPushRuleConditionStringRoomMemberCount, @"The default content rule with room_member_count condition must fire first");
XCTAssertEqual(condition.kindType, MXPushRuleConditionTypeRoomMemberCount);
XCTAssertEqualObjects(condition.kind, kMXPushRuleConditionStringEventMatch, @"The default content rule with room_member_count condition must fire first");
XCTAssertEqual(condition.kindType, MXPushRuleConditionTypeEventMatch);

// Check the right event has been notified
XCTAssertEqualObjects(event.content[kMXMessageBodyKey], messageFromAlice, @"The wrong messsage has been caught. event: %@", event);
Expand Down
46 changes: 5 additions & 41 deletions MatrixSDKTests/MXRestClientTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1112,23 +1112,22 @@ - (void)testAddAndRemoveTag
#pragma mark - Filter operations
- (void)testFilter
{
[self.matrixSDKTestsData doMXRestClientTestWithAlice:self readyToTest:^(MXRestClient *aliceRestClient, XCTestExpectation *expectation) {
[self.matrixSDKTestsData doMXRestClientTestWithBobAndAliceInARoom:self
readyToTest:^(MXRestClient *bobRestClient, MXRestClient *aliceRestClient, NSString *roomId, XCTestExpectation *expectation) {

MXFilterJSONModel *filter = [[MXFilterJSONModel alloc] init];

filter.eventFields = @[@"content.body"];
filter.eventFormat = @"federation";

filter.room = [[MXRoomFilter alloc] init];
filter.room.rooms = @[@"!aroom:matrix:org"];
filter.room.notRooms = @[@"!notaroom:matrix:org"];
filter.room.rooms = @[roomId];

filter.room.ephemeral = [[MXRoomEventFilter alloc] init];
filter.room.ephemeral.containsURL = NO;
filter.room.ephemeral.types = @[@"atype"];
filter.room.ephemeral.notTypes = @[@"notatype"];
filter.room.ephemeral.rooms = @[@"!aroom_ephemeral:matrix:org"];
filter.room.ephemeral.notRooms = @[@"!notaroom_ephemeral:matrix:org"];
filter.room.ephemeral.rooms = @[roomId];;
filter.room.ephemeral.senders = @[@"@asender:matrix.org"];
filter.room.ephemeral.notSenders = @[@"@notasender:matrix.org"];

Expand Down Expand Up @@ -1333,42 +1332,7 @@ - (void)testPushRules
// Check data sent by the home server has been correcltly modelled
XCTAssertTrue([pushRules.global isKindOfClass:[MXPushRulesSet class]]);

XCTAssertNotNil(pushRules.global.content);
XCTAssertTrue([pushRules.global.content isKindOfClass:[NSArray class]]);

MXPushRule *pushRule = pushRules.global.content[0];
XCTAssertTrue([pushRule isKindOfClass:[MXPushRule class]]);

XCTAssertNotNil(pushRule.actions);

MXPushRuleAction *pushAction = pushRule.actions[0];
XCTAssertTrue([pushAction isKindOfClass:[MXPushRuleAction class]]);

// Test a rule with room_member_count condition. There must be one for 1:1 in underride rules
MXPushRule *roomMemberCountRule;
for (MXPushRule *pushRule in pushRules.global.underride)
{
if (pushRule.conditions.count)
{
MXPushRuleCondition *condition = pushRule.conditions[0];
if (condition.kindType == MXPushRuleConditionTypeRoomMemberCount)
{
roomMemberCountRule = pushRule;
break;
}
}
}
XCTAssertNotNil(roomMemberCountRule);

MXPushRuleCondition *condition = roomMemberCountRule.conditions[0];
XCTAssertNotNil(condition);
XCTAssertEqualObjects(condition.kind, kMXPushRuleConditionStringRoomMemberCount);

XCTAssertEqual(condition.kindType, MXPushRuleConditionTypeRoomMemberCount);

XCTAssertNotNil(condition.parameters);
NSNumber *number= condition.parameters[@"is"];
XCTAssertEqual(number.intValue, 2);
// TODO: Check new default push rules

[expectation fulfill];

Expand Down
17 changes: 11 additions & 6 deletions MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,25 @@
"MXAggregatedEditsTests\/testEditsFromInitialSync",
"MXAggregatedEditsTests\/testFormatedEditsFromInitialSync",
"MXAggregatedEditsTests\/testFormattedEditSendAndReceive",
"MXAggregatedEditsUnitTests",
"MXAggregatedReferenceUnitTests",
"MXAsyncTaskQueueUnitTests",
"MXAuthenticationSessionUnitTests",
"MXAggregatedEditsTests\/testFormattedEditServerSide",
"MXAggregatedEditsUnitTests",
"MXAggregatedReactionTests\/testAggregationsFromInitialSync",
"MXAggregatedReactionTests\/testReactionsWhenPaginatingFromAGappyInitialSync",
"MXAggregatedReactionTests\/testReactionsWhenPaginatingFromAGappySync",
"MXAggregatedReactionTests\/testUnreactAfterInitialSync",
"MXAggregatedReactionTests\/testUnreactOnEventReactedByOther",
"MXAggregatedReferenceTests\/testE2EFetchAllReferenceEvents",
"MXAggregatedReferenceTests\/testReferenceFromInitialSync",
"MXAggregatedReferenceUnitTests",
"MXAsyncTaskQueueUnitTests",
"MXAuthenticationSessionUnitTests",
"MXAutoDiscoveryTests\/testAutoDiscoveryNotJSON",
"MXAutoDiscoveryTests\/testAutoDiscoverySuccessful",
"MXAutoDiscoveryTests\/testAutoDiscoverySuccessfulWithNoContentType",
"MXBackgroundSyncServiceTests\/testStoreWithGappyAndOutdatedSync()",
"MXBackgroundTaskUnitTests",
"MXBeaconInfoUnitTests",
"MXCredentialsUnitTests",
"MXBackgroundSyncServiceTests\/testStoreWithGappyAndOutdatedSync()",
"MXCrossSigningTests",
"MXCrossSigningVerificationTests",
"MXCrossSigningVerificationTests\/testVerificationByDMFullFlow",
Expand All @@ -53,6 +55,7 @@
"MXCryptoRecoveryServiceTests",
"MXCryptoRequestsUnitTests",
"MXCryptoSecretShareTests\/testSecretRequestCancellation",
"MXCryptoSecretStorageTests\/testDeleteSecret",
"MXCryptoShareTests",
"MXCryptoTests",
"MXErrorUnitTests",
Expand Down Expand Up @@ -80,8 +83,8 @@
"MXMyUserTests\/testIdenticon",
"MXOlmDeviceUnitTests",
"MXPeekingRoomTests\/testPeekingOnNonWorldReadable",
"MXPollRelationTests\/testBobAndAliceAnswer",
"MXPollAggregatorTest\/testEditing()",
"MXPollRelationTests\/testBobAndAliceAnswer",
"MXPushRuleUnitTests",
"MXQRCodeDataUnitTests",
"MXReplyEventParserUnitTests",
Expand All @@ -106,6 +109,8 @@
"MXSelfSignedHomeserverTests\/testTrustedCertificate",
"MXSessionTests",
"MXSharedHistoryKeyManagerUnitTests",
"MXSpaceChildContentTests\/testUpdateChildSuggestion()",
"MXSpaceChildContentTests\/testUpgradeSpaceChild()",
"MXStoreFileStoreTests",
"MXStoreMemoryStoreTests",
"MXStoreNoStoreTests\/testMXNoStoreSeveralPaginateBacks",
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-1628.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tests: Fix or disable flakey integration tests