Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ecb46ee
Turn logging on in only integration tests
lawrence-forooghian Oct 23, 2025
c478541
Run tests in loop (until failure) on iOS
lawrence-forooghian Oct 23, 2025
27b68dd
Turned off all tests except integration.
maratal Oct 24, 2025
103fdeb
Pin ably-cocoa to 295-chat-tests-ci-hang-investigation branch.
maratal Oct 25, 2025
42cc1ab
Fix mocks.
maratal Oct 25, 2025
b55b97e
Package update.
maratal Oct 25, 2025
69025cf
Lint fixes.
maratal Oct 25, 2025
8df5546
Package.resolved
maratal Oct 25, 2025
ec55ad8
Disabled second integration test.
maratal Oct 25, 2025
22fbe66
Package.resolved
maratal Oct 25, 2025
df07e16
Package.resolved
maratal Oct 25, 2025
3410af8
Package.resolved
maratal Oct 25, 2025
3734866
Package.resolved
maratal Oct 25, 2025
e6fae98
Package.resolved
maratal Oct 25, 2025
5d64a81
Package.resolved
maratal Oct 26, 2025
7e2e303
Package.resolved
maratal Oct 26, 2025
3e7abdc
update with further logging
lawrence-forooghian Oct 27, 2025
d78a11c
bump ably-cocoa
lawrence-forooghian Oct 27, 2025
79701d6
add further logging
lawrence-forooghian Oct 27, 2025
0ffb874
Try UIDevice threading fix
lawrence-forooghian Oct 27, 2025
06d5a75
Revert "Try UIDevice threading fix"
lawrence-forooghian Oct 27, 2025
b935c4f
bump ably-cocoa
lawrence-forooghian Oct 27, 2025
a50cfa1
bump again
lawrence-forooghian Oct 27, 2025
e1a092d
try removing UIDevice access
lawrence-forooghian Oct 27, 2025
e4aa70a
Asked Claude to print backtrace of all threads upon hang
lawrence-forooghian Oct 27, 2025
67c2131
Revert "try removing UIDevice access"
lawrence-forooghian Oct 27, 2025
dc4ef6d
Revert "Asked Claude to print backtrace of all threads upon hang"
lawrence-forooghian Oct 28, 2025
e55e841
switch to https://github.com/ably/ably-cocoa/pull/2133
lawrence-forooghian Oct 28, 2025
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
11 changes: 10 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,16 @@ jobs:
run: swift run BuildTool build-library-for-testing --platform ${{ matrix.platform }}

- name: Run tests
run: swift run BuildTool test-library --platform ${{ matrix.platform }}
run: |
if [ "${{ matrix.platform }}" == "iOS" ]; then
for i in {1..100}; do
echo "BEGIN: Test run $i of 100"
swift run BuildTool test-library --platform ${{ matrix.platform }}
echo "END: Test run $i of 100"
done
else
swift run BuildTool test-library --platform ${{ matrix.platform }}
fi

# TODO: Disabled after this started failing when we switched to Xcode 26; investigate https://github.com/ably/ably-chat-swift/issues/361
# code-coverage:
Expand Down
6 changes: 3 additions & 3 deletions AblyChat.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let package = Package(
// This is the SDK's only dependency.
.package(
url: "https://github.com/ably/ably-cocoa",
from: "1.2.48",
branch: "remove-UIDevice-access", // from: "1.2.48",
),

// All of the following dependencies are only used for internal purposes (testing or build tooling).
Expand Down
92 changes: 91 additions & 1 deletion TestPlans/AllTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,102 @@
},
"testTargets" : [
{
"skippedTests" : {
"suites" : [
{
"name" : "ChatAPITests"
},
{
"name" : "ChatClientTests"
},
{
"name" : "DefaultInternalLoggerTests"
},
{
"name" : "DefaultMessageReactionsTests"
},
{
"name" : "DefaultMessagesTests"
},
{
"name" : "DefaultPresenceTests"
},
{
"name" : "DefaultRoomLifecycleManagerTests"
},
{
"name" : "DefaultRoomOccupancyTests"
},
{
"name" : "DefaultRoomReactionsTests"
},
{
"name" : "DefaultRoomsTests"
},
{
"name" : "DefaultRoomTests"
},
{
"name" : "DefaultTypingTests"
},
{
"name" : "ErrorInfoTests"
},
{
"name" : "IntegrationTests",
"testFunctions" : [
"roomNameWithSlashInTheName()"
]
},
{
"name" : "InternalLoggerTests"
},
{
"name" : "JSONValueTests"
},
{
"name" : "MessageSubscriptionResponseAsyncSequenceTests"
},
{
"name" : "MessageTests"
},
{
"name" : "RoomOptionsTests"
},
{
"name" : "RoomReactionDTOTests"
},
{
"name" : "StringEncodeTests"
},
{
"name" : "SubscriptionAsyncSequenceTests"
},
{
"name" : "SubscriptionStorageTests"
},
{
"name" : "TypingOperationQueueTests"
},
{
"name" : "TypingTimerManagerTests"
}
],
"xctestClasses" : [
{
"name" : "DefaultRoomLifecycleManager"
},
{
"name" : "DefaultRooms"
}
]
},
"target" : {
"containerPath" : "container:",
"identifier" : "AblyChatTests",
"name" : "AblyChatTests"
}
}
],
"version" : 1
"version" : 2
}
16 changes: 7 additions & 9 deletions Tests/AblyChatTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ struct IntegrationTests {
realtimeOptions.environment = "sandbox"
realtimeOptions.clientId = UUID().uuidString

if TestLogger.loggingEnabled {
realtimeOptions.logLevel = .verbose
realtimeOptions.logHandler = AblyCocoaLogger(label: loggingLabel)
}
realtimeOptions.logLevel = .verbose
realtimeOptions.logHandler = AblyCocoaLogger(label: loggingLabel)

return ARTRealtime(options: realtimeOptions)
}

private static func createSandboxChatClient(apiKey: String, loggingLabel: String) -> ChatClient {
let realtime = createSandboxRealtime(apiKey: apiKey, loggingLabel: loggingLabel)
let clientOptions = TestLogger.loggingEnabled ? ChatClientOptions(logHandler: .simple(ChatLogger(label: loggingLabel)), logLevel: .trace) : nil
let clientOptions = ChatClientOptions(logHandler: .simple(ChatLogger(label: loggingLabel)), logLevel: .trace)

return ChatClient(realtime: realtime, clientOptions: clientOptions)
}
Expand All @@ -82,9 +80,9 @@ struct IntegrationTests {
Self.logAwait("AFTER Sandbox.createAPIKey()")

// (1) Create a couple of chat clients — one for sending and one for receiving
let txClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "tx")
let txClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "basic-tx")
let txClientID = try #require(txClient.clientID)
let rxClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "rx")
let rxClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "basic-rx")

// (2) Fetch a room
let roomName = "basketball"
Expand Down Expand Up @@ -668,8 +666,8 @@ struct IntegrationTests {
Self.logAwait("AFTER Sandbox.createAPIKey()")

// (1) Create a couple of chat clients — one for sending and one for receiving
let txClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "tx-slash")
let rxClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "rx-slash")
let txClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "slash-tx")
let rxClient = Self.createSandboxChatClient(apiKey: apiKey, loggingLabel: "slash-rx")

// (2) Fetch a room with a slash in the name
let roomName = "room/with/slash"
Expand Down
28 changes: 28 additions & 0 deletions Tests/AblyChatTests/Mocks/MockAblyCocoaRealtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ final class MockAblyCocoaRealtime: NSObject, RealtimeClientProtocol, @unchecked
fatalError("Not implemented")
}

var modes: ARTChannelMode {
fatalError("Not implemented")
}

var properties: ARTChannelProperties {
fatalError("Not implemented")
}
Expand Down Expand Up @@ -311,6 +315,30 @@ final class MockAblyCocoaRealtime: NSObject, RealtimeClientProtocol, @unchecked
}

final class Annotations: RealtimeAnnotationsProtocol {
func publish(for _: ARTMessage, annotation _: ARTOutboundAnnotation, callback _: ARTCallback? = nil) {
fatalError("Not implemented")
}

func publish(forMessageSerial _: String, annotation _: ARTOutboundAnnotation, callback _: ARTCallback? = nil) {
fatalError("Not implemented")
}

func delete(for _: ARTMessage, annotation _: ARTOutboundAnnotation, callback _: ARTCallback? = nil) {
fatalError("Not implemented")
}

func delete(forMessageSerial _: String, annotation _: ARTOutboundAnnotation, callback _: ARTCallback? = nil) {
fatalError("Not implemented")
}

func getFor(_: ARTMessage, query _: ARTAnnotationsQuery, callback _: @escaping ARTPaginatedAnnotationsCallback) {
fatalError("Not implemented")
}

func getForMessageSerial(_: String, query _: ARTAnnotationsQuery, callback _: @escaping ARTPaginatedAnnotationsCallback) {
fatalError("Not implemented")
}

func subscribe(_: @escaping ARTAnnotationCallback) -> ARTEventListener? {
fatalError("Not implemented")
}
Expand Down
Loading