diff --git a/MatrixSDKTests/MXNotificationCenterTests.m b/MatrixSDKTests/MXNotificationCenterTests.m index d4366425ae..a22465f6b4 100644 --- a/MatrixSDKTests/MXNotificationCenterTests.m +++ b/MatrixSDKTests/MXNotificationCenterTests.m @@ -275,7 +275,7 @@ - (void)testDefaultDisplayNameCondition }]; } -- (void)testDefaultRoomMemberCountCondition +- (void)testDefaultEventMatchCondition { [matrixSDKTestsData doMXSessionTestWithBobAndAliceInARoom:self readyToTest:^(MXSession *bobSession, MXRestClient *aliceRestClient, NSString *roomId, XCTestExpectation *expectation) { @@ -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); diff --git a/MatrixSDKTests/MXRestClientTests.m b/MatrixSDKTests/MXRestClientTests.m index 2406d6445d..7cd11d8b54 100644 --- a/MatrixSDKTests/MXRestClientTests.m +++ b/MatrixSDKTests/MXRestClientTests.m @@ -1112,7 +1112,8 @@ - (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]; @@ -1120,15 +1121,13 @@ - (void)testFilter 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"]; @@ -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]; diff --git a/MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan b/MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan index 24fd2e67a5..fb12ca99dc 100644 --- a/MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan +++ b/MatrixSDKTests/TestPlans/AllWorkingTests.xctestplan @@ -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", @@ -53,6 +55,7 @@ "MXCryptoRecoveryServiceTests", "MXCryptoRequestsUnitTests", "MXCryptoSecretShareTests\/testSecretRequestCancellation", + "MXCryptoSecretStorageTests\/testDeleteSecret", "MXCryptoShareTests", "MXCryptoTests", "MXErrorUnitTests", @@ -80,8 +83,8 @@ "MXMyUserTests\/testIdenticon", "MXOlmDeviceUnitTests", "MXPeekingRoomTests\/testPeekingOnNonWorldReadable", - "MXPollRelationTests\/testBobAndAliceAnswer", "MXPollAggregatorTest\/testEditing()", + "MXPollRelationTests\/testBobAndAliceAnswer", "MXPushRuleUnitTests", "MXQRCodeDataUnitTests", "MXReplyEventParserUnitTests", @@ -106,6 +109,8 @@ "MXSelfSignedHomeserverTests\/testTrustedCertificate", "MXSessionTests", "MXSharedHistoryKeyManagerUnitTests", + "MXSpaceChildContentTests\/testUpdateChildSuggestion()", + "MXSpaceChildContentTests\/testUpgradeSpaceChild()", "MXStoreFileStoreTests", "MXStoreMemoryStoreTests", "MXStoreNoStoreTests\/testMXNoStoreSeveralPaginateBacks", diff --git a/changelog.d/pr-1628.bugfix b/changelog.d/pr-1628.bugfix new file mode 100644 index 0000000000..8ee0cac862 --- /dev/null +++ b/changelog.d/pr-1628.bugfix @@ -0,0 +1 @@ +Tests: Fix or disable flakey integration tests \ No newline at end of file