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

WIP test against the lmars-dev cluster #1950

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
env:
LC_CTYPE: en_US.UTF-8
LANG: en_US.UTF-8
ABLY_ENV: sandbox
ABLY_ENV: lmars-dev

steps:
- name: Check out repo
Expand Down
5 changes: 0 additions & 5 deletions Source/ARTWebSocketTransport.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ - (ARTRealtimeTransportError *)classifyError:(NSError *)error {
- (void)webSocket:(id<ARTWebSocket>)webSocket didReceiveMessage:(id)message {
ARTLogVerbose(self.logger, @"R:%p WS:%p websocket did receive message", _delegate, self);

if (self.websocket.readyState == ARTWebSocketReadyStateClosed) {
ARTLogDebug(self.logger, @"R:%p WS:%p websocket is closed, message has been ignored", _delegate, self);
return;
}

if ([message isKindOfClass:[NSString class]]) {
[self webSocketMessageText:(NSString *)message];
} else if ([message isKindOfClass:[NSData class]]) {
Expand Down
2 changes: 1 addition & 1 deletion Test/Test Utilities/TestUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public func delay(_ seconds: TimeInterval, closure: @escaping () -> Void) {
public func getEnvironment() -> String {
let b = Bundle(for: AblyTests.self)
guard let env = b.infoDictionary!["ABLY_ENV"] as? String, env.count > 0 else {
return "sandbox"
return "lmars-dev"
}
return env
}
Expand Down
5 changes: 0 additions & 5 deletions Test/Tests/AuthTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@
guard let errorInfo = stateChange.reason else {
fail("ErrorInfo is nil"); done(); return
}
expect(errorInfo.message).to(contain("No application found with id"))

Check failure on line 415 in Test/Tests/AuthTests.swift

View workflow job for this annotation

GitHub Actions / check (iOS, test_iOS17_2)

test__025__Token__authentication_method__in_Realtime__if_the_connection_fails_due_to_a_terminal_token_error__then_the_connection_should_move_to_the_FAILED_state_and_reports_the_error, expected to contain <No application found with id>, got <token invalid. (See https://help.ably.io/error/40101 for help.)>

Check failure on line 415 in Test/Tests/AuthTests.swift

View workflow job for this annotation

GitHub Actions / check (tvOS, test_tvOS17_2)

test__025__Token__authentication_method__in_Realtime__if_the_connection_fails_due_to_a_terminal_token_error__then_the_connection_should_move_to_the_FAILED_state_and_reports_the_error, expected to contain <No application found with id>, got <token invalid. (See https://help.ably.io/error/40101 for help.)>
done()
}
realtime.connection.once(.disconnected) { _ in
fail("Should not reach Disconnected state"); done()

Check failure on line 419 in Test/Tests/AuthTests.swift

View workflow job for this annotation

GitHub Actions / check (macOS, test_macOS)

test__025__Token__authentication_method__in_Realtime__if_the_connection_fails_due_to_a_terminal_token_error__then_the_connection_should_move_to_the_FAILED_state_and_reports_the_error, Should not reach Disconnected state
}
realtime.connect()
}
Expand Down Expand Up @@ -4087,7 +4087,6 @@
fail("Reason error is nil"); done(); return
}
XCTAssertEqual(reason.code, ARTErrorCode.invalidJwtFormat.intValue)
expect(reason.description).to(satisfyAnyOf(contain("invalid signature"), contain("signature verification failed")))
done()
}
client.connect()
Expand Down Expand Up @@ -4138,7 +4137,6 @@
fail("Reason error is nil"); done(); return
}
XCTAssertEqual(reason.code, ARTErrorCode.invalidJwtFormat.intValue)
expect(reason.description).to(satisfyAnyOf(contain("invalid signature"), contain("signature verification failed")))
done()
}
client.connect()
Expand All @@ -4164,7 +4162,6 @@
client.connection.once(.connected) { stateChange in
client.connection.once(.disconnected) { stateChange in
XCTAssertEqual(stateChange.reason?.code, ARTErrorCode.tokenExpired.intValue)
expect(stateChange.reason?.description).to(contain("Key/token status changed (expire)"))
done()
}
}
Expand Down Expand Up @@ -4258,7 +4255,6 @@
fail("Reason error is nil"); done(); return
}
XCTAssertEqual(reason.code, ARTErrorCode.invalidJwtFormat.intValue)
expect(reason.description).to(satisfyAnyOf(contain("invalid signature"), contain("signature verification failed")))
done()
}
client.connect()
Expand Down Expand Up @@ -4335,7 +4331,6 @@
waitUntil(timeout: testTimeout) { done in
client.channels.get(channelName).publish(messageName, data: nil, callback: { error in
XCTAssertEqual(error?.code, ARTErrorCode.operationNotPermittedWithProvidedCapability.intValue)
expect(error?.message).to(contain("permission denied"))
done()
})
}
Expand Down
1 change: 0 additions & 1 deletion Test/Tests/RealtimeClientConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@
}

expect(start).toEventuallyNot(beNil(), timeout: testTimeout)
expect(end).toEventuallyNot(beNil(), timeout: DispatchTimeInterval.milliseconds(Int(1000.0 * ARTDefault.realtimeRequestTimeout())))

Check failure on line 1714 in Test/Tests/RealtimeClientConnectionTests.swift

View workflow job for this annotation

GitHub Actions / check (iOS, test_iOS17_2)

test__047__Connection__close__should_transition_to_CLOSED_action_when_the_close_process_timeouts, expected to eventually not be nil, got <nil>

if states.count != 2 {
fail("Invalid number of connection states. Expected CLOSING and CLOSE states")
Expand Down Expand Up @@ -2096,7 +2096,6 @@
}
XCTAssertEqual(reason.code, ARTErrorCode.tokenExpired.intValue)
XCTAssertEqual(reason.statusCode, 401)
expect(reason.message).to(contain("Key/token status changed (expire)"))
partialDone()
}
client.connect()
Expand Down
4 changes: 2 additions & 2 deletions Test/Tests/RealtimeClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ class RealtimeClientTests: XCTestCase {
}

client.auth.authorize(nil, options: authOptions) { tokenDetails, error in
guard let error = error else {
guard let error = error as? ARTErrorInfo else {
fail("ErrorInfo is nil"); partialDone(); return
}
expect(error.localizedDescription).to(contain("Invalid accessToken"))
XCTAssertEqual(error.code, ARTErrorCode.invalidCredential.intValue)
XCTAssertEqual(tokenDetails?.token, invalidToken)
authError = error as NSError?
partialDone()
Expand Down
4 changes: 2 additions & 2 deletions Test/Tests/RestClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1310,9 +1310,9 @@ class RestClientTests: XCTestCase {

// RSC15i
func test__066__RestClient__Host_Fallback__retry_hosts_in_random_order__environment_fallback_hosts_have_the_format__environment___a_e__fallback_ably_realtime_com() {
let environmentFallbackHosts = ARTDefault.fallbackHosts(withEnvironment: "sandbox")
let environmentFallbackHosts = ARTDefault.fallbackHosts(withEnvironment: "lmars-dev")
environmentFallbackHosts.forEach { host in
expect(host).to(match("sandbox-[a-e]-fallback.ably-realtime.com"))
expect(host).to(match("lmars-dev-[a-e]-fallback.ably-realtime.com"))
}
XCTAssertEqual(environmentFallbackHosts.count, 5)
}
Expand Down
4 changes: 2 additions & 2 deletions Test/Tests/RestPaginatedTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import XCTest

private let links = "<./messages?start=0&end=1535035746063&limit=100&direction=backwards&format=msgpack&firstEnd=1535035746063&fromDate=1535035746063&mode=all>; rel=\"first\", <./messages?start=0&end=1535035746063&limit=100&direction=backwards&format=msgpack&firstEnd=1535035746063&fromDate=1535035746063&mode=all>; rel=\"current\""

private let url = URL(string: "https://sandbox-rest.ably.io:443/channels/foo/messages?limit=100&direction=backwards")!
private let url = URL(string: "https://lmars-dev-rest.ably.io:443/channels/foo/messages?limit=100&direction=backwards")!

class RestPaginatedTests: XCTestCase {
// XCTest invokes this method before executing the first test in the test suite. We use it to ensure that the global variables are initialized at the same moment, and in the same order, as they would have been when we used the Quick testing framework.
Expand Down Expand Up @@ -44,6 +44,6 @@ class RestPaginatedTests: XCTestCase {
fail("First link isn't a valid URL"); return
}

XCTAssertEqual(firstRequest.url?.absoluteString, "https://sandbox-rest.ably.io:443/channels/foo/messages?start=0&end=1535035746063&limit=100&direction=backwards&format=msgpack&firstEnd=1535035746063&fromDate=1535035746063&mode=all")
XCTAssertEqual(firstRequest.url?.absoluteString, "https://lmars-dev-rest.ably.io:443/channels/foo/messages?start=0&end=1535035746063&limit=100&direction=backwards&format=msgpack&firstEnd=1535035746063&fromDate=1535035746063&mode=all")
}
}
Loading