Skip to content

Commit

Permalink
fix more build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
caldrian committed Jun 24, 2024
1 parent ce53f05 commit 797d8bb
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_reusable_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
xcodebuild test -retry-tests-on-failure -workspace wire-ios-mono.xcworkspace -scheme WireSystem -destination 'platform=iOS Simulator,OS=${{ env.IOS_VERSION }},name=${{ env.IPHONE_MODEL }}' | tee -a xcodebuild-wire-ios-system.log | bundle exec xcpretty --report junit --output build/reports/WireSystem.junit
exit ${PIPESTATUS[0]}
- uses: tbartelmess/analyze-xcoderesults-action@0.1.1
- uses: hoangapvn/analyze-xcoderesults-action
if: ${{ inputs.wire-ios-system || inputs.all }}
with:
results: xcodebuild-wire-ios-system.xcresult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public final class ConversationList: NSObject {
shortDescription() + "\n" + super.description
}

func resort() {
public func resort() {
let backingList = NSMutableArray(array: backingList)
backingList.sort(comparator: comparator)
self.backingList = backingList as! [ZMConversation]
Expand Down
8 changes: 4 additions & 4 deletions wire-ios-data-model/WireDataModel.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
54FB03AF1E41FC86000E13DC /* NSManagedObjectContext+Patches.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FB03AE1E41FC86000E13DC /* NSManagedObjectContext+Patches.swift */; };
55C40BCE22B0316800EFD8BD /* ZMUser+LegalHoldRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55C40BCD22B0316800EFD8BD /* ZMUser+LegalHoldRequest.swift */; };
55C40BD722B0F78500EFD8BD /* ZMUserLegalHoldTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55C40BD422B0F75C00EFD8BD /* ZMUserLegalHoldTests.swift */; };
5904070A2C258C810009542C /* ConversationContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 590407092C258C810009542C /* ConversationContainer.swift */; };
5904070A2C258C810009542C /* ConversationList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 590407092C258C810009542C /* ConversationList.swift */; };
590C55752B62BF0000FC1CE8 /* MLSGroupID+random.swift in Sources */ = {isa = PBXBuildFile; fileRef = 590C55742B62BF0000FC1CE8 /* MLSGroupID+random.swift */; };
591362E62B70F45C000B210C /* MLSVerificationStatusTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 591362E52B70F45C000B210C /* MLSVerificationStatusTests.swift */; };
591942B62B6A4B4D0000B390 /* UserObserving.swift in Sources */ = {isa = PBXBuildFile; fileRef = 591942B52B6A4B4D0000B390 /* UserObserving.swift */; };
Expand Down Expand Up @@ -1201,7 +1201,7 @@
54FB03AE1E41FC86000E13DC /* NSManagedObjectContext+Patches.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSManagedObjectContext+Patches.swift"; sourceTree = "<group>"; };
55C40BCD22B0316800EFD8BD /* ZMUser+LegalHoldRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ZMUser+LegalHoldRequest.swift"; sourceTree = "<group>"; };
55C40BD422B0F75C00EFD8BD /* ZMUserLegalHoldTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZMUserLegalHoldTests.swift; sourceTree = "<group>"; };
590407092C258C810009542C /* ConversationContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationContainer.swift; sourceTree = "<group>"; };
590407092C258C810009542C /* ConversationList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversationList.swift; sourceTree = "<group>"; };
590C55742B62BF0000FC1CE8 /* MLSGroupID+random.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MLSGroupID+random.swift"; sourceTree = "<group>"; };
591362E52B70F45C000B210C /* MLSVerificationStatusTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MLSVerificationStatusTests.swift; sourceTree = "<group>"; };
591942B52B6A4B4D0000B390 /* UserObserving.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserObserving.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3597,7 +3597,7 @@
F9C9A7371CAE6D890039E10C /* ConversationList */ = {
isa = PBXGroup;
children = (
590407092C258C810009542C /* ConversationContainer.swift */,
590407092C258C810009542C /* ConversationList.swift */,
1672A6272344F10700380537 /* FolderList.swift */,
F9B71F071CB264DF001DB03F /* ZMConversationListDirectory.h */,
F9B71F081CB264DF001DB03F /* ZMConversationListDirectory.m */,
Expand Down Expand Up @@ -4318,7 +4318,7 @@
A99B8A72268221A6006B4D29 /* ZMImageMessage.swift in Sources */,
BF3493F21EC3623200B0C314 /* ZMUser+Teams.swift in Sources */,
541E4F951CBD182100D82D69 /* FileAssetCache.swift in Sources */,
5904070A2C258C810009542C /* ConversationContainer.swift in Sources */,
5904070A2C258C810009542C /* ConversationList.swift in Sources */,
E9A96E7A2B88B64800914FDD /* PushSupportedProtocolsAction.swift in Sources */,
0614E96D2A863EED007BB1F6 /* NSPredicate+BaseCompounds.swift in Sources */,
165911551DF054AD007FA847 /* ZMConversation+Predicates.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,13 @@ class CallStateObserverTests: DatabaseTest, CallNotificationStyleProvider {
// > "Other"
// > "Main" (Muted)

let list = syncMOC.performAndWait {
let list: ConversationList = syncMOC.performAndWait {
// this is expected to be done on viewContext,
// but test needs to check on syncMoc
ZMConversation.conversationsExcludingArchived(in: syncMOC)
}

if let first = list.firstObject as? ZMConversation,
let last = list.lastObject as? ZMConversation {
if let first = list.items.first, let last = list.items.last {
XCTAssertEqual(first, otherConvo!)
XCTAssertEqual(last, self.conversation)
} else {
Expand All @@ -504,13 +503,11 @@ class CallStateObserverTests: DatabaseTest, CallNotificationStyleProvider {
// > "Main" (JOIN) (Muted)
// > "Other"

if let first = list.firstObject as? ZMConversation,
let last = list.lastObject as? ZMConversation {
if let first = list.items.first, let last = list.items.last {
XCTAssertEqual(first, self.conversation)
XCTAssertEqual(last, otherConvo!)
} else {
XCTFail()
}
}

}
88 changes: 44 additions & 44 deletions wire-ios-sync-engine/Tests/Source/Integration/ConnectionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ - (void)testThatWhenConnectingToASearchUserAndResynchronizingWeHaveThatConnectio
XCTAssertTrue([self login]);

// then
NSArray *allConversations = [ZMConversationList conversationsInUserSession:self.userSession];
ZMConversation *foundConversation = [allConversations firstObjectMatchingWithBlock:^BOOL(ZMConversation *conv) {
ZMConversationList *allConversations = [ZMConversationList conversationsInUserSession:self.userSession];
ZMConversation *foundConversation = [allConversations.items firstObjectMatchingWithBlock:^BOOL(ZMConversation *conv) {
if([conv.connectedUser.name isEqualToString:@"Karl McUser"]) {
return YES;
}
Expand Down Expand Up @@ -167,8 +167,8 @@ - (void)testThatAPendingIncomingConnectionRequestIsDisplayedCorrectly;
XCTAssertEqual(conversation.connectedUser, otherUser);

//pending connections should be in pending conversations list
XCTAssertFalse([active containsObject:conversation]);
XCTAssertTrue([pending containsObject:conversation]);
XCTAssertFalse([active.items containsObject:conversation]);
XCTAssertTrue([pending.items containsObject:conversation]);
}

- (void)testThatASentConnectionRequestIsDisplayedCorrectly;
Expand All @@ -194,8 +194,8 @@ - (void)testThatASentConnectionRequestIsDisplayedCorrectly;
XCTAssertEqual(conversation.connectedUser, otherUser);

//sent connections should be in active conversations list
XCTAssertTrue([active containsObject:conversation]);
XCTAssertFalse([pending containsObject:conversation]);
XCTAssertTrue([active.items containsObject:conversation]);
XCTAssertFalse([pending.items containsObject:conversation]);
}


Expand All @@ -210,8 +210,8 @@ - (void)testThatAConnectionRequestIsRemovedFromThePendingConnectionsListWhenItIs
XCTAssertEqual(user, conversation.connectedUser);

ZMConversationList *pending = [ZMConversationList pendingConnectionConversationsInUserSession:self.userSession];
XCTAssertTrue([pending containsObject:conversation]);
XCTAssertTrue([pending.items containsObject:conversation]);

ConversationListChangeObserver *observer = [[ConversationListChangeObserver alloc] initWithConversationList:pending];

// when ignoring:
Expand All @@ -220,7 +220,7 @@ - (void)testThatAConnectionRequestIsRemovedFromThePendingConnectionsListWhenItIs


// then
XCTAssertFalse([pending containsObject:conversation]);
XCTAssertFalse([pending.items containsObject:conversation]);
XCTAssertEqual(observer.notifications.count, 1u);
}

Expand All @@ -235,8 +235,8 @@ - (void)testThatAConnectionRequestIsRemovedFromConversationsListWhenItIsCancelle
XCTAssertEqual(user, conversation.connectedUser);

ZMConversationList *conversations = [ZMConversationList conversationsIncludingArchivedInUserSession:self.userSession];
XCTAssertTrue([conversations containsObject:conversation]);
XCTAssertTrue([conversations.items containsObject:conversation]);

ConversationListChangeObserver *observer = [[ConversationListChangeObserver alloc] initWithConversationList:conversations];

// when cancelling:
Expand All @@ -245,7 +245,7 @@ - (void)testThatAConnectionRequestIsRemovedFromConversationsListWhenItIsCancelle


// then
XCTAssertFalse([conversations containsObject:conversation]);
XCTAssertFalse([conversations.items containsObject:conversation]);
XCTAssertEqual(observer.notifications.count, 1u);
}

Expand All @@ -272,10 +272,10 @@ - (void)testThatConnectionRequestsFromTwoUsersAreBothAddedToActiveConversations;
ZMConversationList *active = [ZMConversationList conversationsInUserSession:self.userSession];
ZMConversationList *pending = [ZMConversationList pendingConnectionConversationsInUserSession:self.userSession];

XCTAssertFalse([active containsObject:conversation1]);
XCTAssertFalse([active containsObject:conversation2]);
XCTAssertTrue([pending containsObject:conversation1]);
XCTAssertTrue([pending containsObject:conversation2]);
XCTAssertFalse([active.items containsObject:conversation1]);
XCTAssertFalse([active.items containsObject:conversation2]);
XCTAssertTrue([pending.items containsObject:conversation1]);
XCTAssertTrue([pending.items containsObject:conversation2]);


ConversationListChangeObserver *pendingObserver = [[ConversationListChangeObserver alloc] initWithConversationList:pending];
Expand All @@ -288,11 +288,11 @@ - (void)testThatConnectionRequestsFromTwoUsersAreBothAddedToActiveConversations;

// then

XCTAssertTrue([active containsObject:conversation1]);
XCTAssertTrue([active containsObject:conversation2]);
XCTAssertFalse([pending containsObject:conversation1]);
XCTAssertFalse([pending containsObject:conversation2]);
XCTAssertTrue([active.items containsObject:conversation1]);
XCTAssertTrue([active.items containsObject:conversation2]);
XCTAssertFalse([pending.items containsObject:conversation1]);
XCTAssertFalse([pending.items containsObject:conversation2]);

XCTAssertEqual(conversation1.conversationType, ZMConversationTypeOneOnOne);
XCTAssertEqual(conversation2.conversationType, ZMConversationTypeOneOnOne);

Expand Down Expand Up @@ -475,8 +475,8 @@ - (void)disabled_testThatConnectionRequestsToTwoUsersAreAddedToPending
XCTAssertTrue([self login]);

ZMConversationList *active = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger count = active.count;
NSUInteger count = active.items.count;

ConversationListChangeObserver *listObserver = [[ConversationListChangeObserver alloc] initWithConversationList:active];

ZMConversation *conv1;
Expand Down Expand Up @@ -507,7 +507,7 @@ - (void)disabled_testThatConnectionRequestsToTwoUsersAreAddedToPending
conv2 = realUser2.oneToOneConversation;
XCTAssertNotNil(conv2);

XCTAssertEqual(active.count, count+2);
XCTAssertEqual(active.items.count, count+2);
}

ConversationChangeObserver *observer = self.conversationChangeObserver;
Expand Down Expand Up @@ -575,9 +575,9 @@ - (void)DISABLED_testThatWeDontSeeASystemMessageWhenAUserAcceptsAConnectionReque

XCTAssertTrue([self login]);

NSArray *active = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger count = active.count;
ZMConversationList *active = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger count = active.items.count;

ZMConversation *conv1;

// when we search and send connection requests to users
Expand All @@ -596,7 +596,7 @@ - (void)DISABLED_testThatWeDontSeeASystemMessageWhenAUserAcceptsAConnectionReque

conv1 = realUser1.oneToOneConversation;
XCTAssertNotNil(conv1);
XCTAssertEqual(active.count, count+1);
XCTAssertEqual(active.items.count, count+1);
}


Expand Down Expand Up @@ -772,8 +772,8 @@ - (void)testThatItNotifiesObserversWhenWeSendAConnectionRequest
XCTAssertTrue([self login]);

ZMConversationList *activeConversations = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger activeCount = activeConversations.count;
NSUInteger activeCount = activeConversations.items.count;

ConversationListChangeObserver *observer = [[ConversationListChangeObserver alloc] initWithConversationList:activeConversations];
[observer clearNotifications];

Expand All @@ -788,8 +788,8 @@ - (void)testThatItNotifiesObserversWhenWeSendAConnectionRequest

// we should see one new active conversation
{
XCTAssertEqual(activeConversations.count, activeCount+1u);
XCTAssertEqual(activeConversations.items.count, activeCount+1u);

NSArray *notifications = observer.notifications;
XCTAssertNotNil(notifications);

Expand Down Expand Up @@ -817,8 +817,8 @@ - (void)testThatItTheConnectionRequestConversationIsOnTopOfTheConversationList

XCTAssertTrue([self login]);

NSArray *active = [ZMConversationList conversationsInUserSession:self.userSession];
ZMConversationList *active = [ZMConversationList conversationsInUserSession:self.userSession];

// when we search and send connection requests to users
[self.userSession performChanges:^{
[self searchAndConnectToUserWithName:userName1 searchQuery:@"Hans"];
Expand All @@ -829,7 +829,7 @@ - (void)testThatItTheConnectionRequestConversationIsOnTopOfTheConversationList

ZMUser *user = [self userForMockUser:mockUser];
ZMConversation *conversation = user.oneToOneConversation;
XCTAssertEqualObjects(active.firstObject, conversation);
XCTAssertEqualObjects(active.items.firstObject, conversation);
}

- (void)testThatItResendsConnectionRequestAfterItWasCancelled
Expand All @@ -844,15 +844,15 @@ - (void)testThatItResendsConnectionRequestAfterItWasCancelled
XCTAssertEqual(user, conversation.connectedUser);

ZMConversationList *conversations = [ZMConversationList conversationsIncludingArchivedInUserSession:self.userSession];
XCTAssertTrue([conversations containsObject:conversation]);
XCTAssertTrue([conversations.items containsObject:conversation]);

ConversationListChangeObserver *observer = [[ConversationListChangeObserver alloc] initWithConversationList:conversations];

// when cancelling:
[user cancelConnectionRequestWithCompletion:^(NSError * error) { NOT_USED(error); }];
WaitForAllGroupsToBeEmpty(0.5);

XCTAssertFalse([conversations containsObject:conversation]);
XCTAssertFalse([conversations.items containsObject:conversation]);
XCTAssertEqual(observer.notifications.count, 1u);
[observer clearNotifications];

Expand All @@ -861,7 +861,7 @@ - (void)testThatItResendsConnectionRequestAfterItWasCancelled
WaitForAllGroupsToBeEmpty(0.5);

// then
XCTAssertTrue([conversations containsObject:conversation]);
XCTAssertTrue([conversations.items containsObject:conversation]);
XCTAssertEqual(observer.notifications.count, 1u);
}

Expand Down Expand Up @@ -892,14 +892,14 @@ - (void)testThatItDeletesTheConversationWhenConnectionIsRejectedByBackendAndNoti

XCTAssertTrue([self login]);
ZMConversationList *conversations = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger beforeInsertingCount = conversations.count;
NSUInteger beforeInsertingCount = conversations.items.count;

// when
[self searchAndConnectToUserWithName:searchUserName searchQuery:@"McUser"];
[self.mockTransportSession waitForAllRequestsToCompleteWithTimeout:0.5];

// then
XCTAssertEqual(conversations.count, beforeInsertingCount);
XCTAssertEqual(conversations.items.count, beforeInsertingCount);
}

#pragma mark - MissingLegalHoldConsent
Expand All @@ -926,14 +926,14 @@ - (void)testThatItDeletesTheConversationWhenConnectionIsRejectedByBackend_Missin

XCTAssertTrue([self login]);
ZMConversationList *conversations = [ZMConversationList conversationsInUserSession:self.userSession];
NSUInteger beforeInsertingCount = conversations.count;
NSUInteger beforeInsertingCount = conversations.items.count;

// when
[self searchAndConnectToUserWithName:searchUserName searchQuery:@"McUser"];
[self.mockTransportSession waitForAllRequestsToCompleteWithTimeout:0.5];

// then
XCTAssertEqual(conversations.count, beforeInsertingCount);
XCTAssertEqual(conversations.items.count, beforeInsertingCount);
}

@end
Loading

0 comments on commit 797d8bb

Please sign in to comment.