From b04883e4b31a34db913022940dbd1542d4e34979 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 12:17:09 +0200 Subject: [PATCH 01/11] test: move assethub test cases to separate steps in chopsticks tests --- .github/workflows/xcm-tests.yml | 69 +++++++++++++++++++- package.json | 4 +- scripts/chopsticks-test.ts | 34 +++++----- scripts/interlay-chopsticks-test.ts | 19 ++---- scripts/kintsugi-chopsticks-test.ts | 10 ++- scripts/kusama-chopsticks-assethub-test.ts | 40 ++++++++++++ scripts/polkadot-chopsticks-assethub-test.ts | 40 ++++++++++++ 7 files changed, 179 insertions(+), 37 deletions(-) create mode 100644 scripts/kusama-chopsticks-assethub-test.ts create mode 100644 scripts/polkadot-chopsticks-assethub-test.ts diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 1f1668ef..67e45196 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -10,7 +10,6 @@ on: branches: - master - jobs: chopsticks_kintsugi_test: runs-on: ubuntu-latest @@ -25,7 +24,6 @@ jobs: xcm \ -r scripts/configs/kusama.yml \ -p scripts/configs/kintsugi.yml \ - -p scripts/configs/statemine.yml \ -p scripts/configs/karura.yml \ -p scripts/configs/parallel-heiko.yml \ -p scripts/configs/bifrost.yml \ @@ -55,6 +53,39 @@ jobs: path: log.txt retention-days: 7 + chopsticks_kusama_assethub_test: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Launch chopsticks + run: | + npx --yes @acala-network/chopsticks@0.9.3 \ + xcm \ + -r scripts/configs/kusama.yml \ + -p scripts/configs/kintsugi.yml \ + -p scripts/configs/statemine.yml \ + &> log.txt & + echo "Waiting for log to show chopsticks is ready..." + tail -f log.txt | grep -q "Connected parachains" + echo "... detected chopsticks is ready." + + - name: Run Kusama AssetHub tests + run: | + yarn install --frozen-lockfile + npx ts-node scripts/kusama-chopsticks-assethub-test.ts + - name: Show error log + if: failure() + run: | + tail -n 100 log.txt + # - name: Report status to Discord + # uses: sarisia/actions-status-discord@v1 + # if: failure() + # with: + # webhook: ${{ secrets.DISCORD_WEBHOOK }} + chopsticks_interlay_test: runs-on: ubuntu-latest timeout-minutes: 30 @@ -68,7 +99,6 @@ jobs: xcm \ -r scripts/configs/polkadot.yml \ -p scripts/configs/interlay.yml \ - -p scripts/configs/statemint.yml \ -p scripts/configs/hydradx.yml \ -p scripts/configs/acala.yml \ -p scripts/configs/astar.yml \ @@ -100,3 +130,36 @@ jobs: name: interlay-chopsticks-logs path: log.txt retention-days: 7 + + chopsticks_polkadot_assethub_test: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Launch chopsticks + run: | + npx --yes @acala-network/chopsticks@0.9.3 \ + xcm \ + -r scripts/configs/polkadot.yml \ + -p scripts/configs/interlay.yml \ + -p scripts/configs/statemint.yml \ + &> log.txt & + echo "Waiting for log to show chopsticks is ready..." + tail -f log.txt | grep -q "Connected parachains" + echo "... detected chopsticks is ready." + + - name: Run Polkadot AssetHub tests + run: | + yarn install --frozen-lockfile + npx ts-node scripts/polkadot-chopsticks-assethub-test.ts + - name: Show error log + if: failure() + run: | + tail -n 100 log.txt + # - name: Report status to Discord + # uses: sarisia/actions-status-discord@v1 + # if: failure() + # with: + # webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/package.json b/package.json index f16465f8..574c191e 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,9 @@ "test:ci": "jest --forceExit", "lint": "polkadot-dev-run-lint", "chopsticks-test:kintsugi": "ts-node scripts/kintsugi-chopsticks-test", - "chopsticks-test:interlay": "ts-node scripts/interlay-chopsticks-test" + "chopsticks-test:interlay": "ts-node scripts/interlay-chopsticks-test", + "chopsticks-test:kusama-assethub": "ts-node scripts/kusama-chopsticks-assethub-test", + "chopsticks-test:polkadot-assethub": "ts-node scripts/polkadot-chopsticks-assethub-test" }, "peerDependencies": { "@polkadot/api": "^10" diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index 696e2d65..64c836d4 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -191,11 +191,13 @@ async function retryCheckTransfer( * Can skip specific test cases provided by the skipCases filter, and will also skip routes if no matching adapter has been provided. * * @param adapterEndpoints Records containing ChainName as key, an instantiated adapter and a list of ws(s) links as endpoints for each. + * @param includeAssetHubSepcialCases Boolean value whether to add realy chaing to/from assethub test cases (true) or not (false). * @param skipCases An array of xcm test cases to skip. */ export async function runTestCasesAndExit( // record key is chainname adapterEndpoints: Record }>, + includeAssetHubSepcialCases: boolean = false, // skip cases: array of to, from and/or token to skip tests for skipCases: Partial[] = [] ): Promise { @@ -231,21 +233,23 @@ export async function runTestCasesAndExit( })); // add in special cases: polkadot/kusama <=> asset hub - const relayId = chains.includes("polkadot") ? "polkadot" : "kusama"; - const assetHubId = relayId === "polkadot" ? "statemint" : "statemine"; - const token = relayId === "polkadot" ? "DOT" : "KSM"; - testCases.push( - { - to: assetHubId as ChainName, - from: relayId as ChainName, - token - }, - { - to: relayId as ChainName, - from: assetHubId as ChainName, - token - }, - ); + if (includeAssetHubSepcialCases) { + const relayId = chains.includes("polkadot") ? "polkadot" : "kusama"; + const assetHubId = relayId === "polkadot" ? "statemint" : "statemine"; + const token = relayId === "polkadot" ? "DOT" : "KSM"; + testCases.push( + { + to: assetHubId as ChainName, + from: relayId as ChainName, + token + }, + { + to: relayId as ChainName, + from: assetHubId as ChainName, + token + }, + ); + } const isSkipCase = (testCase: {to: ChainName, from: ChainName, token: string}): boolean => { return skipCases.some((skipCase) => diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index 69a45577..e1a111c1 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -3,7 +3,6 @@ /* tslint:disable:no-unused-variable */ import { PolkadotAdapter } from "../src/adapters/polkadot"; import { InterlayAdapter } from "../src/adapters/interlay"; -import { StatemintAdapter } from "../src/adapters/statemint"; import { HydraAdapter } from "../src/adapters/hydradx"; import { AcalaAdapter } from "../src/adapters/acala"; import { AstarAdapter } from "../src/adapters/astar"; @@ -25,17 +24,13 @@ async function main(): Promise { // reminder: parachains get ports in oder of arguments, starting with 8000 and incremented for each following one; // relaychain gets its port last after all parachains. interlay: { adapter: new InterlayAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, - statemint: { adapter: new StatemintAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, - hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, - acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, - astar: { adapter: new AstarAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8005'] }, - bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8006']}, - polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8007'] }, + hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, + acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + astar: { adapter: new AstarAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, + parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, + bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005']}, + polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8006'] }, }; - const filterCases: Partial[] = [ - ]; - - await runTestCasesAndExit(adaptersEndpoints, filterCases); + await runTestCasesAndExit(adaptersEndpoints); } \ No newline at end of file diff --git a/scripts/kintsugi-chopsticks-test.ts b/scripts/kintsugi-chopsticks-test.ts index 3b2f3e07..9d99b019 100644 --- a/scripts/kintsugi-chopsticks-test.ts +++ b/scripts/kintsugi-chopsticks-test.ts @@ -6,7 +6,6 @@ import { BifrostKusamaAdapter } from "../src/adapters/bifrost"; import { KintsugiAdapter } from "../src/adapters/interlay"; import { HeikoAdapter } from "../src/adapters/parallel"; import { KusamaAdapter } from "../src/adapters/polkadot"; -import { StatemineAdapter } from "../src/adapters/statemint"; import { BaseCrossChainAdapter } from "../src/base-chain-adapter"; import { runTestCasesAndExit } from "./chopsticks-test"; @@ -23,11 +22,10 @@ async function main(): Promise { // reminder: parachains get ports in oder of arguments, starting with 8000 and incremented for each following one; // relaychain gets its port last after all parachains. kintsugi: { adapter: new KintsugiAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, - statemine: { adapter: new StatemineAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, - karura: { adapter: new KaruraAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, - heiko: { adapter: new HeikoAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, - bifrost: { adapter: new BifrostKusamaAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - kusama: { adapter: new KusamaAdapter(), endpoints: ['ws://127.0.0.1:8005'] }, + karura: { adapter: new KaruraAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, + heiko: { adapter: new HeikoAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + bifrost: { adapter: new BifrostKusamaAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, + kusama: { adapter: new KusamaAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, }; await runTestCasesAndExit(adaptersEndpoints); diff --git a/scripts/kusama-chopsticks-assethub-test.ts b/scripts/kusama-chopsticks-assethub-test.ts new file mode 100644 index 00000000..54902f34 --- /dev/null +++ b/scripts/kusama-chopsticks-assethub-test.ts @@ -0,0 +1,40 @@ +/* eslint @typescript-eslint/no-var-requires: "off" */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* tslint:disable:no-unused-variable */ +import { KintsugiAdapter } from "../src/adapters/interlay"; +import { StatemineAdapter } from "../src/adapters/statemint"; +import { KusamaAdapter } from "../src/adapters/polkadot"; +import { BaseCrossChainAdapter } from "../src/base-chain-adapter"; +import { RouterTestCase, runTestCasesAndExit } from "./chopsticks-test"; + +main().catch((err) => { + console.log("Error thrown by script:"); + console.log(err); + process.exit(-1); +}); + +async function main(): Promise { + const adaptersEndpoints : Record }> = { + // make sure endpoints are aligned with the ports spun up by chopsticks config in + // .github/workflows/xcm-tests.yml + // reminder: parachains get ports in oder of arguments, starting with 8000 and incremented for each following one; + // relaychain gets its port last after all parachains. + kintsugi: { adapter: new KintsugiAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, + statemine: { adapter: new StatemineAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, + kusama: { adapter: new KusamaAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + }; + + // already tested in kintsugi-chopsticks-test + const skipCases: Partial[] = [ + { + from: "kintsugi", + to: "kusama", + }, + { + from: "kusama", + to: "kintsugi", + }, + ]; + + await runTestCasesAndExit(adaptersEndpoints, true, skipCases); +} \ No newline at end of file diff --git a/scripts/polkadot-chopsticks-assethub-test.ts b/scripts/polkadot-chopsticks-assethub-test.ts new file mode 100644 index 00000000..35fc126b --- /dev/null +++ b/scripts/polkadot-chopsticks-assethub-test.ts @@ -0,0 +1,40 @@ +/* eslint @typescript-eslint/no-var-requires: "off" */ +/* eslint-disable @typescript-eslint/no-unused-vars */ +/* tslint:disable:no-unused-variable */ +import { PolkadotAdapter } from "../src/adapters/polkadot"; +import { InterlayAdapter } from "../src/adapters/interlay"; +import { StatemintAdapter } from "../src/adapters/statemint"; +import { BaseCrossChainAdapter } from "../src/base-chain-adapter"; +import { RouterTestCase, runTestCasesAndExit } from "./chopsticks-test"; + +main().catch((err) => { + console.log("Error thrown by script:"); + console.log(err); + process.exit(-1); +}); + +async function main(): Promise { + const adaptersEndpoints : Record }> = { + // make sure endpoints are aligned with the ports spun up by chopsticks config in + // .github/workflows/xcm-tests.yml + // reminder: parachains get ports in oder of arguments, starting with 8000 and incremented for each following one; + // relaychain gets its port last after all parachains. + interlay: { adapter: new InterlayAdapter(), endpoints: ['ws://127.0.0.1:8000'] }, + statemint: { adapter: new StatemintAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, + polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, + }; + + // already tested in interlay-chopsticks-test + const skipCases: Partial[] = [ + { + from: "interlay", + to: "polkadot", + }, + { + from: "polkadot", + to: "interlay", + }, + ]; + + await runTestCasesAndExit(adaptersEndpoints, true, skipCases); +} \ No newline at end of file From 9fec737bba0080fd59be28b95ad0eca8a3b6ae65 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 12:23:31 +0200 Subject: [PATCH 02/11] fix: remove unused import --- scripts/interlay-chopsticks-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index e1a111c1..9c97bdd6 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -9,7 +9,7 @@ import { AstarAdapter } from "../src/adapters/astar"; import { ParallelAdapter } from "../src/adapters/parallel"; import { BifrostPolkadotAdapter } from "../src/adapters/bifrost"; import { BaseCrossChainAdapter } from "../src/base-chain-adapter"; -import { RouterTestCase, runTestCasesAndExit } from "./chopsticks-test"; +import { runTestCasesAndExit } from "./chopsticks-test"; main().catch((err) => { console.log("Error thrown by script:"); From 3796fae135950ad6db2e98b5611c6eaea8d9160d Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 12:35:01 +0200 Subject: [PATCH 03/11] test: adjust frequency and timeouts for chopsticks tests --- .github/workflows/xcm-tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 67e45196..863d526e 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -2,7 +2,7 @@ name: Daily XCM tests on: schedule: - - cron: '5 * * * *' # Run hourly + - cron: '12 */2 * * *' # Run every 2 hours push: branches: - master @@ -13,7 +13,7 @@ on: jobs: chopsticks_kintsugi_test: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v4 @@ -55,7 +55,7 @@ jobs: chopsticks_kusama_assethub_test: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v4 @@ -88,7 +88,7 @@ jobs: chopsticks_interlay_test: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v4 @@ -133,7 +133,7 @@ jobs: chopsticks_polkadot_assethub_test: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 10 steps: - name: Checkout uses: actions/checkout@v4 From 21f689aa3abfcbf48a0a859a028bfb8ddf948394 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 13:01:56 +0200 Subject: [PATCH 04/11] test: set shorter timeout for launching chopsticks --- .github/workflows/xcm-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 863d526e..72518d08 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -19,6 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ @@ -61,6 +62,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ @@ -94,6 +96,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ @@ -139,6 +142,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ From 97c1a5f3efabe9a52f13527998595ddd40a98984 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 13:18:11 +0200 Subject: [PATCH 05/11] test: separate xcm test actions --- .github/workflows/xcm-assethub-tests.yml | 80 ++++++++++++++++++++++++ .github/workflows/xcm-tests.yml | 70 +-------------------- 2 files changed, 81 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/xcm-assethub-tests.yml diff --git a/.github/workflows/xcm-assethub-tests.yml b/.github/workflows/xcm-assethub-tests.yml new file mode 100644 index 00000000..dfd3336a --- /dev/null +++ b/.github/workflows/xcm-assethub-tests.yml @@ -0,0 +1,80 @@ +--- +name: AssetHub XCM tests +on: + schedule: + - cron: '38 */2 * * *' # Run every 2 hours + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + chopsticks_kusama_assethub_test: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Launch chopsticks + timeout-minutes: 3 + run: | + npx --yes @acala-network/chopsticks@0.9.3 \ + xcm \ + -r scripts/configs/kusama.yml \ + -p scripts/configs/kintsugi.yml \ + -p scripts/configs/statemine.yml \ + &> log.txt & + echo "Waiting for log to show chopsticks is ready..." + tail -f log.txt | grep -q "Connected parachains" + echo "... detected chopsticks is ready." + + - name: Run Kusama AssetHub tests + run: | + yarn install --frozen-lockfile + npx ts-node scripts/kusama-chopsticks-assethub-test.ts + - name: Show error log + if: failure() + run: | + tail -n 100 log.txt + - name: Report status to Discord + uses: sarisia/actions-status-discord@v1 + if: failure() + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + + chopsticks_polkadot_assethub_test: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Launch chopsticks + timeout-minutes: 3 + run: | + npx --yes @acala-network/chopsticks@0.9.3 \ + xcm \ + -r scripts/configs/polkadot.yml \ + -p scripts/configs/interlay.yml \ + -p scripts/configs/statemint.yml \ + &> log.txt & + echo "Waiting for log to show chopsticks is ready..." + tail -f log.txt | grep -q "Connected parachains" + echo "... detected chopsticks is ready." + + - name: Run Polkadot AssetHub tests + run: | + yarn install --frozen-lockfile + npx ts-node scripts/polkadot-chopsticks-assethub-test.ts + - name: Show error log + if: failure() + run: | + tail -n 100 log.txt + - name: Report status to Discord + uses: sarisia/actions-status-discord@v1 + if: failure() + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 72518d08..252eced3 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -1,5 +1,5 @@ --- -name: Daily XCM tests +name: XCM tests on: schedule: - cron: '12 */2 * * *' # Run every 2 hours @@ -54,40 +54,6 @@ jobs: path: log.txt retention-days: 7 - chopsticks_kusama_assethub_test: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Launch chopsticks - timeout-minutes: 3 - run: | - npx --yes @acala-network/chopsticks@0.9.3 \ - xcm \ - -r scripts/configs/kusama.yml \ - -p scripts/configs/kintsugi.yml \ - -p scripts/configs/statemine.yml \ - &> log.txt & - echo "Waiting for log to show chopsticks is ready..." - tail -f log.txt | grep -q "Connected parachains" - echo "... detected chopsticks is ready." - - - name: Run Kusama AssetHub tests - run: | - yarn install --frozen-lockfile - npx ts-node scripts/kusama-chopsticks-assethub-test.ts - - name: Show error log - if: failure() - run: | - tail -n 100 log.txt - # - name: Report status to Discord - # uses: sarisia/actions-status-discord@v1 - # if: failure() - # with: - # webhook: ${{ secrets.DISCORD_WEBHOOK }} - chopsticks_interlay_test: runs-on: ubuntu-latest timeout-minutes: 15 @@ -133,37 +99,3 @@ jobs: name: interlay-chopsticks-logs path: log.txt retention-days: 7 - - chopsticks_polkadot_assethub_test: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Launch chopsticks - timeout-minutes: 3 - run: | - npx --yes @acala-network/chopsticks@0.9.3 \ - xcm \ - -r scripts/configs/polkadot.yml \ - -p scripts/configs/interlay.yml \ - -p scripts/configs/statemint.yml \ - &> log.txt & - echo "Waiting for log to show chopsticks is ready..." - tail -f log.txt | grep -q "Connected parachains" - echo "... detected chopsticks is ready." - - - name: Run Polkadot AssetHub tests - run: | - yarn install --frozen-lockfile - npx ts-node scripts/polkadot-chopsticks-assethub-test.ts - - name: Show error log - if: failure() - run: | - tail -n 100 log.txt - # - name: Report status to Discord - # uses: sarisia/actions-status-discord@v1 - # if: failure() - # with: - # webhook: ${{ secrets.DISCORD_WEBHOOK }} From 26dbf8820cb07ad73112168ad46d173e8959a5ce Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 13:29:53 +0200 Subject: [PATCH 06/11] chore: switch around parallel endpoints --- scripts/configs/parallel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configs/parallel.yml b/scripts/configs/parallel.yml index 743b97a7..98e3e45c 100644 --- a/scripts/configs/parallel.yml +++ b/scripts/configs/parallel.yml @@ -1,6 +1,6 @@ endpoint: - - wss://parallel-rpc.dwellir.com - wss://polkadot-rpc.parallel.fi + - wss://parallel-rpc.dwellir.com mock-signature-host: true import-storage: From 531e11afe5ccbe3a2d789125577e0edbac548040 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 13:38:29 +0200 Subject: [PATCH 07/11] chore: revert order change for parallel --- scripts/configs/parallel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/configs/parallel.yml b/scripts/configs/parallel.yml index 98e3e45c..743b97a7 100644 --- a/scripts/configs/parallel.yml +++ b/scripts/configs/parallel.yml @@ -1,6 +1,6 @@ endpoint: - - wss://polkadot-rpc.parallel.fi - wss://parallel-rpc.dwellir.com + - wss://polkadot-rpc.parallel.fi mock-signature-host: true import-storage: From 3d4e0d6db975eddd98699567badde775303fdb0a Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 13:39:12 +0200 Subject: [PATCH 08/11] test: increase chopsticks launch timeout for normal xcm tests --- .github/workflows/xcm-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 252eced3..bc5bc8e6 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks - timeout-minutes: 3 + timeout-minutes: 5 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ @@ -62,7 +62,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks - timeout-minutes: 3 + timeout-minutes: 5 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ From 0a839da24d78b56876757885e336e9d811172f7a Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 14:49:07 +0200 Subject: [PATCH 09/11] test: revert timeout for chopsticks launch back to 3 minutes --- .github/workflows/xcm-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index bc5bc8e6..252eced3 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks - timeout-minutes: 5 + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ @@ -62,7 +62,7 @@ jobs: uses: actions/checkout@v4 - name: Launch chopsticks - timeout-minutes: 5 + timeout-minutes: 3 run: | npx --yes @acala-network/chopsticks@0.9.3 \ xcm \ From 67a82f14aab6edbc89b2faf6c0ec31266b330298 Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 16:30:14 +0200 Subject: [PATCH 10/11] test: disable parllelfi tests in chopsticks --- .github/workflows/xcm-tests.yml | 1 - scripts/interlay-chopsticks-test.ts | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/xcm-tests.yml b/.github/workflows/xcm-tests.yml index 252eced3..08088672 100644 --- a/.github/workflows/xcm-tests.yml +++ b/.github/workflows/xcm-tests.yml @@ -71,7 +71,6 @@ jobs: -p scripts/configs/hydradx.yml \ -p scripts/configs/acala.yml \ -p scripts/configs/astar.yml \ - -p scripts/configs/parallel.yml \ -p scripts/configs/bifrost-polkadot.yml \ &> log.txt & echo "Waiting for log to show chopsticks is ready..." diff --git a/scripts/interlay-chopsticks-test.ts b/scripts/interlay-chopsticks-test.ts index 9c97bdd6..795a78de 100644 --- a/scripts/interlay-chopsticks-test.ts +++ b/scripts/interlay-chopsticks-test.ts @@ -6,7 +6,7 @@ import { InterlayAdapter } from "../src/adapters/interlay"; import { HydraAdapter } from "../src/adapters/hydradx"; import { AcalaAdapter } from "../src/adapters/acala"; import { AstarAdapter } from "../src/adapters/astar"; -import { ParallelAdapter } from "../src/adapters/parallel"; +// import { ParallelAdapter } from "../src/adapters/parallel"; import { BifrostPolkadotAdapter } from "../src/adapters/bifrost"; import { BaseCrossChainAdapter } from "../src/base-chain-adapter"; import { runTestCasesAndExit } from "./chopsticks-test"; @@ -27,9 +27,9 @@ async function main(): Promise { hydra: { adapter: new HydraAdapter(), endpoints: ['ws://127.0.0.1:8001'] }, acala: { adapter: new AcalaAdapter(), endpoints: ['ws://127.0.0.1:8002'] }, astar: { adapter: new AstarAdapter(), endpoints: ['ws://127.0.0.1:8003'] }, - parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, - bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005']}, - polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8006'] }, + // parallel: { adapter: new ParallelAdapter(), endpoints: ['ws://127.0.0.1:8004'] }, + bifrost_polkadot: { adapter: new BifrostPolkadotAdapter(), endpoints: ['ws://127.0.0.1:8004']}, + polkadot: { adapter: new PolkadotAdapter(), endpoints: ['ws://127.0.0.1:8005'] }, }; await runTestCasesAndExit(adaptersEndpoints); From d910f86ced07ad0d7ef094bfa886209f675c4d7a Mon Sep 17 00:00:00 2001 From: Brendon Votteler Date: Wed, 17 Jan 2024 18:23:33 +0200 Subject: [PATCH 11/11] chore: fix typos --- scripts/chopsticks-test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/chopsticks-test.ts b/scripts/chopsticks-test.ts index 64c836d4..c3d1dd13 100644 --- a/scripts/chopsticks-test.ts +++ b/scripts/chopsticks-test.ts @@ -191,13 +191,13 @@ async function retryCheckTransfer( * Can skip specific test cases provided by the skipCases filter, and will also skip routes if no matching adapter has been provided. * * @param adapterEndpoints Records containing ChainName as key, an instantiated adapter and a list of ws(s) links as endpoints for each. - * @param includeAssetHubSepcialCases Boolean value whether to add realy chaing to/from assethub test cases (true) or not (false). + * @param includeAssetHubSpecialCases Boolean value whether to add relay chain to/from assethub test cases (true) or not (false). * @param skipCases An array of xcm test cases to skip. */ export async function runTestCasesAndExit( // record key is chainname adapterEndpoints: Record }>, - includeAssetHubSepcialCases: boolean = false, + includeAssetHubSpecialCases: boolean = false, // skip cases: array of to, from and/or token to skip tests for skipCases: Partial[] = [] ): Promise { @@ -233,7 +233,7 @@ export async function runTestCasesAndExit( })); // add in special cases: polkadot/kusama <=> asset hub - if (includeAssetHubSepcialCases) { + if (includeAssetHubSpecialCases) { const relayId = chains.includes("polkadot") ? "polkadot" : "kusama"; const assetHubId = relayId === "polkadot" ? "statemint" : "statemine"; const token = relayId === "polkadot" ? "DOT" : "KSM";