diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 6e8895d0d..1565d4c02 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -14,7 +14,7 @@ jobs: env: LC_CTYPE: en_US.UTF-8 LANG: en_US.UTF-8 - ABLY_ENV: sandbox + ABLY_ENV: amnon-dev steps: - name: Checkout repo diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index f49235800..6f7fb8fc2 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -32,7 +32,7 @@ jobs: env: LC_CTYPE: en_US.UTF-8 LANG: en_US.UTF-8 - ABLY_ENV: sandbox + ABLY_ENV: amnon-dev steps: - name: Check out repo diff --git a/Examples/Tests/TestsTests/TestsTests.swift b/Examples/Tests/TestsTests/TestsTests.swift index d932d186c..31e7d505e 100644 --- a/Examples/Tests/TestsTests/TestsTests.swift +++ b/Examples/Tests/TestsTests/TestsTests.swift @@ -18,7 +18,7 @@ class TestsTests: XCTestCase { var responseData: Data? let postAppExpectation = self.expectation(description: "POST app to sandbox") - let request = NSMutableURLRequest(url: URL(string: "https://sandbox-rest.ably.io:443/apps")!) + let request = NSMutableURLRequest(url: URL(string: "https://amnon-dev-rest-admin.ably.io:443/apps")!) request.httpMethod = "POST" request.httpBody = "{\"keys\":[{}]}".data(using: String.Encoding.utf8) request.allHTTPHeaderFields = [ diff --git a/Makefile b/Makefile index 4d0960816..c90ff78ad 100644 --- a/Makefile +++ b/Makefile @@ -67,15 +67,15 @@ submodules: ## [Tests] Run tests on iOS 14.4 using sandbox environment test_iOS: - ABLY_ENV="sandbox" NAME="ably-iOS" bundle exec fastlane test_iOS16_2 + ABLY_ENV="amnon-dev" NAME="ably-iOS" bundle exec fastlane test_iOS16_2 ## [Tests] Run tests on tvOS 14.3 using sandbox environment test_tvOS: - ABLY_ENV="sandbox" NAME="ably-tvOS" bundle exec fastlane test_tvOS16_1 + ABLY_ENV="amnon-dev" NAME="ably-tvOS" bundle exec fastlane test_tvOS16_1 ## [Tests] Run tests on macOS using sandbox environment test_macOS: - ABLY_ENV="sandbox" NAME="ably-macOS" bundle exec fastlane test_macOS + ABLY_ENV="amnon-dev" NAME="ably-macOS" bundle exec fastlane test_macOS ## -- CocoaPods -- diff --git a/Scripts/log-environment-information.sh b/Scripts/log-environment-information.sh index 1d465c801..f071a4243 100755 --- a/Scripts/log-environment-information.sh +++ b/Scripts/log-environment-information.sh @@ -7,5 +7,5 @@ set -e ip=$(curl -s https://api.ipify.org) echo "Public IP address is: $ip" -echo "Output of \`dig sandbox-realtime.ably.io\`:" -dig sandbox-realtime.ably.io +echo "Output of \`dig amnon-dev-realtime.ably.io\`:" +dig amnon-dev-realtime.ably.io diff --git a/Test/Test Utilities/TestUtilities.swift b/Test/Test Utilities/TestUtilities.swift index 09bb0ddac..40ba469cc 100644 --- a/Test/Test Utilities/TestUtilities.swift +++ b/Test/Test Utilities/TestUtilities.swift @@ -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 "amnon-dev" } return env } diff --git a/Test/Tests/AuthTests.swift b/Test/Tests/AuthTests.swift index 143fdb247..15aa74192 100644 --- a/Test/Tests/AuthTests.swift +++ b/Test/Tests/AuthTests.swift @@ -4159,7 +4159,6 @@ class AuthTests: XCTestCase { 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() } } diff --git a/Test/Tests/RealtimeClientConnectionTests.swift b/Test/Tests/RealtimeClientConnectionTests.swift index bf78207d9..c4c962738 100644 --- a/Test/Tests/RealtimeClientConnectionTests.swift +++ b/Test/Tests/RealtimeClientConnectionTests.swift @@ -2098,6 +2098,7 @@ class RealtimeClientConnectionTests: XCTestCase { let test = Test() let options = try AblyTests.commonAppSetup(for: test) options.autoConnect = false + options.logLevel = .debug; options.testOptions.transportFactory = TestProxyTransportFactory() let tokenTtl = 3.0 let tokenDetails = try getTestTokenDetails(for: test, key: options.key, capability: nil, ttl: tokenTtl) @@ -2136,6 +2137,7 @@ class RealtimeClientConnectionTests: XCTestCase { let test = Test() let options = try AblyTests.clientOptions(for: test) options.autoConnect = false + options.logLevel = .debug; let tokenTtl = 1.0 options.token = try getTestToken(for: test, ttl: tokenTtl) options.testOptions.transportFactory = TestProxyTransportFactory() @@ -2146,7 +2148,7 @@ class RealtimeClientConnectionTests: XCTestCase { done() } } - + let client = ARTRealtime(options: options) defer { client.dispose() @@ -2159,6 +2161,8 @@ class RealtimeClientConnectionTests: XCTestCase { client.connection.on { stateChange in let state = stateChange.current let errorInfo = stateChange.reason + print("got state change state: \(stateChange.current)") + print(stateChange.current) switch state { case .connected: fail("Should not be connected") @@ -2167,6 +2171,7 @@ class RealtimeClientConnectionTests: XCTestCase { guard let errorInfo = errorInfo else { fail("ErrorInfo is nil"); done(); return } + print("got errorInfo.code=\(errorInfo.code)") XCTAssertEqual(errorInfo.code, ARTErrorCode.tokenExpired.intValue) done() default: @@ -2179,8 +2184,9 @@ class RealtimeClientConnectionTests: XCTestCase { let failures = transport.protocolMessagesReceived.filter { $0.action == .error } + print("failures.count=\(failures.count)") if failures.count != 1 { - fail("Should have only one connection request fail") + fail("Should have only one connection request fail, got \(failures.count)") return } diff --git a/Test/Tests/RestClientTests.swift b/Test/Tests/RestClientTests.swift index 0b373cd36..7246158d3 100644 --- a/Test/Tests/RestClientTests.swift +++ b/Test/Tests/RestClientTests.swift @@ -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: "amnon-dev") environmentFallbackHosts.forEach { host in - expect(host).to(match("sandbox-[a-e]-fallback.ably-realtime.com")) + expect(host).to(match("amnon-dev-[a-e]-fallback.ably-realtime.com")) } XCTAssertEqual(environmentFallbackHosts.count, 5) } diff --git a/Test/Tests/RestPaginatedTests.swift b/Test/Tests/RestPaginatedTests.swift index 549a8e79c..a882b10b9 100644 --- a/Test/Tests/RestPaginatedTests.swift +++ b/Test/Tests/RestPaginatedTests.swift @@ -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://amnon-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. @@ -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://amnon-dev-rest.ably.io:443/channels/foo/messages?start=0&end=1535035746063&limit=100&direction=backwards&format=msgpack&firstEnd=1535035746063&fromDate=1535035746063&mode=all") } }