diff --git a/.github/actions/run_tests_without_building/action.yml b/.github/actions/run_tests_without_building/action.yml index f8d0a3743..a9639e3db 100644 --- a/.github/actions/run_tests_without_building/action.yml +++ b/.github/actions/run_tests_without_building/action.yml @@ -24,6 +24,10 @@ inputs: gm-dapp-project-secret: description: 'GM DApp Project Secret' required: false + gm-dapp-host: + description: 'GM DApp Host' + required: false + default: 'gm.walletconnect.com' js-client-api-host: description: 'JS Client Api Host' required: false @@ -55,7 +59,7 @@ runs: - name: Run integration tests if: inputs.type == 'integration-tests' shell: bash - run: make integration_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} JS_CLIENT_API_HOST=${{ inputs.js-client-api-host }} + run: make integration_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} JS_CLIENT_API_HOST=${{ inputs.js-client-api-host }} # Relay Integration tests - name: Run Relay integration tests @@ -73,7 +77,7 @@ runs: - name: Run notify tests if: inputs.type == 'notify-tests' shell: bash - run: make notify_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} + run: make notify_tests RELAY_HOST=${{ inputs.relay-endpoint }} PROJECT_ID=${{ inputs.project-id }} CAST_HOST=${{ inputs.notify-endpoint }} GM_DAPP_PROJECT_ID=${{ inputs.gm-dapp-project-id }} GM_DAPP_PROJECT_SECRET=${{ inputs.gm-dapp-project-secret }} GM_DAPP_HOST=${{ inputs.gm-dapp-host }} - name: Run x-platform protocol tests if: inputs.type == 'x-platform-protocol-tests' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef5f81953..5a9b07721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: - name: Run integration tests if: matrix.type == 'integration-tests' shell: bash - run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} JS_CLIENT_API_HOST=test-automation-api.walletconnect.com + run: make integration_tests RELAY_HOST=relay.walletconnect.com PROJECT_ID=${{ secrets.PROJECT_ID }} CAST_HOST=notify.walletconnect.com GM_DAPP_PROJECT_ID=${{ secrets.GM_DAPP_PROJECT_ID }} GM_DAPP_PROJECT_SECRET=${{ secrets.GM_DAPP_PROJECT_SECRET }} GM_DAPP_HOST=gm.walletconnect.com JS_CLIENT_API_HOST=test-automation-api.walletconnect.com # Relay Integration tests - name: Run Relay integration tests diff --git a/Configuration.xcconfig b/Configuration.xcconfig index 361714e46..98daaddd4 100644 --- a/Configuration.xcconfig +++ b/Configuration.xcconfig @@ -9,6 +9,9 @@ RELAY_HOST = relay.walletconnect.com // Uncomment next line and paste dapp's project secret to run all the notify tests // GM_DAPP_PROJECT_SECRET = GM_DAPP_PROJECT_SECRET +// Uncomment next line and paste dapp's host to run all the notify tests +// GM_DAPP_HOST = GM_DAPP_HOST + // Uncomment next line and paste js client's api host to run x-platform tests // JS_CLIENT_API_HOST = JS_CLIENT_API_HOST diff --git a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan index 0fb2db965..896a5c3c7 100644 --- a/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan +++ b/Example/ExampleApp.xcodeproj/IntegrationTests.xctestplan @@ -15,6 +15,10 @@ "key" : "RELAY_HOST", "value" : "$(RELAY_HOST)" }, + { + "key" : "GM_DAPP_HOST", + "value" : "$(GM_DAPP_HOST)" + }, { "key" : "JS_CLIENT_API_HOST", "value" : "$(JS_CLIENT_API_HOST)" @@ -48,7 +52,9 @@ "skippedTests" : [ "AuthTests\/testEIP1271RespondSuccess()", "ChatTests", - "ENSResolverTests" + "ENSResolverTests", + "SyncDerivationServiceTests", + "SyncTests" ], "target" : { "containerPath" : "container:ExampleApp.xcodeproj", diff --git a/Example/IntegrationTests/Push/NotifyTests.swift b/Example/IntegrationTests/Push/NotifyTests.swift index 83b91e47e..36c7f82b8 100644 --- a/Example/IntegrationTests/Push/NotifyTests.swift +++ b/Example/IntegrationTests/Push/NotifyTests.swift @@ -16,7 +16,7 @@ final class NotifyTests: XCTestCase { var walletNotifyClientA: NotifyClient! - let gmDappDomain = "gm.walletconnect.com" + let gmDappDomain = InputConfig.gmDappHost let pk = try! EthereumPrivateKey() @@ -124,7 +124,6 @@ final class NotifyTests: XCTestCase { try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) sleep(1) - try! await clientB.register(account: account, domain: gmDappDomain, onSign: sign) wait(for: [expectation], timeout: InputConfig.defaultTimeout) @@ -188,9 +187,6 @@ final class NotifyTests: XCTestCase { let subscribeExpectation = expectation(description: "creates notify subscription") let messageExpectation = expectation(description: "receives a notify message") let notifyMessage = NotifyMessage.stub() - - let metadata = AppMetadata(name: "GM Dapp", description: "", url: gmDappDomain, icons: []) - try! await walletNotifyClientA.register(account: account, domain: gmDappDomain, onSign: sign) try! await walletNotifyClientA.subscribe(appDomain: gmDappDomain, account: account) diff --git a/Example/IntegrationTests/Push/Publisher.swift b/Example/IntegrationTests/Push/Publisher.swift index 5ee993759..6908ec50b 100644 --- a/Example/IntegrationTests/Push/Publisher.swift +++ b/Example/IntegrationTests/Push/Publisher.swift @@ -4,6 +4,14 @@ import Foundation class Publisher { func notify(topic: String, account: Account, message: NotifyMessage) async throws { let url = URL(string: "https://\(InputConfig.castHost)/\(InputConfig.gmDappProjectId)/notify")! + print("________________________________________") + print("________________________________________") + print("________________________________________") + print(InputConfig.gmDappHost) + print("________________________________________") + print("________________________________________") + print("________________________________________") + var request = URLRequest(url: url) let notifyRequestPayload = NotifyRequest(notification: message, accounts: [account]) let encoder = JSONEncoder() diff --git a/Example/Shared/Tests/InputConfig.swift b/Example/Shared/Tests/InputConfig.swift index e32975741..7f3dd03f5 100644 --- a/Example/Shared/Tests/InputConfig.swift +++ b/Example/Shared/Tests/InputConfig.swift @@ -14,6 +14,10 @@ struct InputConfig { return config(for: "GM_DAPP_PROJECT_ID")! } + static var gmDappHost: String { + return config(for: "GM_DAPP_HOST")! + } + static var gmDappProjectSecret: String { return config(for: "GM_DAPP_PROJECT_SECRET")! } diff --git a/NotifyTests.xctestplan b/NotifyTests.xctestplan index d626fa6e0..881dd5fda 100644 --- a/NotifyTests.xctestplan +++ b/NotifyTests.xctestplan @@ -15,6 +15,10 @@ "key" : "RELAY_HOST", "value" : "$(RELAY_HOST)" }, + { + "key" : "GM_DAPP_HOST", + "value" : "$(GM_DAPP_HOST)" + }, { "key" : "GM_DAPP_PROJECT_SECRET", "value" : "$(GM_DAPP_PROJECT_SECRET)" diff --git a/Sources/WalletConnectRelay/PackageConfig.json b/Sources/WalletConnectRelay/PackageConfig.json index 594e69a66..21c0f27c7 100644 --- a/Sources/WalletConnectRelay/PackageConfig.json +++ b/Sources/WalletConnectRelay/PackageConfig.json @@ -1 +1 @@ -{"version": "1.8.0"} +{"version": "1.8.1"} diff --git a/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift b/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift index bfd5ccd26..a9f6b348d 100644 --- a/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift +++ b/Sources/WalletConnectUtils/Logger/ConsoleLogger.swift @@ -111,8 +111,8 @@ extension ConsoleLogger: ConsoleLogging { #if DEBUG public struct ConsoleLoggerMock: ConsoleLogging { - public var logsPublisher: AnyPublisher { - return PassthroughSubject().eraseToAnyPublisher() + public var logsPublisher: AnyPublisher { + return PassthroughSubject().eraseToAnyPublisher() } public init() {} diff --git a/run_tests.sh b/run_tests.sh index eb906df0e..ea5cad206 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -84,6 +84,7 @@ else update_xctestrun --key "PROJECT_ID" --value "$PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_ID" --value "$GM_DAPP_PROJECT_ID" --target "$XCTESTRUN" update_xctestrun --key "GM_DAPP_PROJECT_SECRET" --value "$GM_DAPP_PROJECT_SECRET" --target "$XCTESTRUN" + update_xctestrun --key "GM_DAPP_HOST" --value "$GM_DAPP_HOST" --target "$XCTESTRUN" update_xctestrun --key "CAST_HOST" --value "$CAST_HOST" --target "$XCTESTRUN" update_xctestrun --key "JS_CLIENT_API_HOST" --value "$JS_CLIENT_API_HOST" --target "$XCTESTRUN"