From 166eb07cc881a737c95af4ad6ee84db8b5c0052f Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 15 Feb 2024 15:50:36 +0100 Subject: [PATCH 1/7] Split `--workspace` test pipeline to separate jobs --- .../workflows/integration-tests-matrix.json | 10 ++ .github/workflows/test.yml | 148 +++++++++++++++++- 2 files changed, 152 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/integration-tests-matrix.json diff --git a/.github/workflows/integration-tests-matrix.json b/.github/workflows/integration-tests-matrix.json new file mode 100644 index 0000000000..f5f50521a5 --- /dev/null +++ b/.github/workflows/integration-tests-matrix.json @@ -0,0 +1,10 @@ +[ + { + "name": "asset-hub-kusama", + "package": "asset-hub-kusama-integration-tests" + }, + { + "name": "asset-hub-polkadot", + "package": "asset-hub-polkadot-integration-tests" + } +] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b2fa8005a..96d27ad692 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,9 +12,39 @@ concurrency: cancel-in-progress: true jobs: - test: - runs-on: ubuntu-22.04 + runtime-matrix: + runs-on: ubuntu-latest + outputs: + runtime: ${{ steps.runtime.outputs.runtime }} + name: Extract tasks from matrix + steps: + - uses: actions/checkout@v2 + - id: runtime + run: | + TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' ) + echo $TASKS + echo "runtime=$TASKS" >> $GITHUB_OUTPUT + integration-test-matrix: + runs-on: ubuntu-latest + outputs: + itest: ${{ steps.itest.outputs.itest }} + name: Extract tasks from matrix + steps: + - uses: actions/checkout@v2 + - id: itest + run: | + TASKS=$(echo $(cat .github/workflows/integration-tests-matrix.json) | sed 's/ //g' ) + echo $TASKS + echo "itest=$TASKS" >> $GITHUB_OUTPUT + + test-runtime: + needs: [ runtime-matrix ] + continue-on-error: true + runs-on: ubuntu-22.04 + strategy: + matrix: + runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} steps: - name: Cancel previous runs uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 @@ -58,13 +88,119 @@ jobs: with: shared-key: "fellowship-cache-tests" - - name: Test - run: cargo test --workspace --release --locked -q --features=runtime-metrics,try-runtime + - name: Test ${{ matrix.runtime.name }} + run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-metrics,try-runtime env: RUSTFLAGS: "-C debug-assertions -D warnings" - - name: Test all features - run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime + - name: Test all features ${{ matrix.runtime.name }} + run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime env: RUSTFLAGS: "-C debug-assertions -D warnings" SKIP_WASM_BUILD: 1 + + integration-test: + needs: [ integration-test-matrix ] + continue-on-error: true + runs-on: ubuntu-22.04 + strategy: + matrix: + runtime: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }} + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 + with: + access_token: ${{ github.token }} + + - name: Install updates and protobuf-compiler + run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler + + - name: Free space on the runner + run: | + df -h + sudo apt -y autoremove --purge + sudo apt -y autoclean + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: wasm32-unknown-unknown + components: rust-src + + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + target: wasm32-unknown-unknown + + - name: Checkout + uses: actions/checkout@v3 + + - name: Fetch cache + uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + with: + shared-key: "fellowship-cache-tests" + + - name: Test ${{ matrix.itest.name }} + run: cargo test -p ${{ matrix.itest.package }} --release --locked -q --features=runtime-metrics,try-runtime + env: + RUSTFLAGS: "-C debug-assertions -D warnings" + + build-chain-spec-generator: + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 + with: + access_token: ${{ github.token }} + + - name: Install updates and protobuf-compiler + run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler + + - name: Free space on the runner + run: | + df -h + sudo apt -y autoremove --purge + sudo apt -y autoclean + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: wasm32-unknown-unknown + components: rust-src + + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + target: wasm32-unknown-unknown + + - name: Checkout + uses: actions/checkout@v3 + + - name: Fetch cache + uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + with: + shared-key: "fellowship-cache-tests" + + - name: Build all features + run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime + env: + RUSTFLAGS: "-C debug-assertions -D warnings" + SKIP_WASM_BUILD: 1 \ No newline at end of file From fe0a2c723db865dcb2bb85cd61145bae79a8ab78 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 15 Feb 2024 15:58:41 +0100 Subject: [PATCH 2/7] Removed features --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96d27ad692..349fc4543f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,12 +89,12 @@ jobs: shared-key: "fellowship-cache-tests" - name: Test ${{ matrix.runtime.name }} - run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-metrics,try-runtime + run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=try-runtime env: RUSTFLAGS: "-C debug-assertions -D warnings" - name: Test all features ${{ matrix.runtime.name }} - run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime + run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --features=runtime-benchmarks,try-runtime env: RUSTFLAGS: "-C debug-assertions -D warnings" SKIP_WASM_BUILD: 1 @@ -199,8 +199,8 @@ jobs: with: shared-key: "fellowship-cache-tests" - - name: Build all features - run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime + - name: Build + run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks env: RUSTFLAGS: "-C debug-assertions -D warnings" SKIP_WASM_BUILD: 1 \ No newline at end of file From 9aa71a4b942a61e8ffebc0c04a4bda6e430ab4ca Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 15 Feb 2024 16:06:54 +0100 Subject: [PATCH 3/7] More fixes --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 349fc4543f..8ab633a96c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest outputs: runtime: ${{ steps.runtime.outputs.runtime }} - name: Extract tasks from matrix + name: Extract runtimes from matrix steps: - uses: actions/checkout@v2 - id: runtime @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest outputs: itest: ${{ steps.itest.outputs.itest }} - name: Extract tasks from matrix + name: Extract integration tests from matrix steps: - uses: actions/checkout@v2 - id: itest @@ -38,7 +38,7 @@ jobs: echo $TASKS echo "itest=$TASKS" >> $GITHUB_OUTPUT - test-runtime: + runtime: needs: [ runtime-matrix ] continue-on-error: true runs-on: ubuntu-22.04 @@ -105,7 +105,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - runtime: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }} + itest: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }} steps: - name: Cancel previous runs uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 From 6e5883801fdf70a663b34eae1944b8c238b427e3 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 15 Feb 2024 16:11:38 +0100 Subject: [PATCH 4/7] More fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ab633a96c..479a150f47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,7 +150,7 @@ jobs: shared-key: "fellowship-cache-tests" - name: Test ${{ matrix.itest.name }} - run: cargo test -p ${{ matrix.itest.package }} --release --locked -q --features=runtime-metrics,try-runtime + run: cargo test -p ${{ matrix.itest.package }} --release --locked -q env: RUSTFLAGS: "-C debug-assertions -D warnings" From f34048d529c9761022c859f33926e2e854114cac Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 15 Feb 2024 16:18:14 +0100 Subject: [PATCH 5/7] Removed unnecessery feature stuff from integration tests --- Cargo.lock | 1 - .../emulated/assets/asset-hub-kusama/Cargo.toml | 3 --- .../emulated/assets/asset-hub-polkadot/Cargo.toml | 5 +---- integration-tests/emulated/chains/Cargo.toml | 5 ----- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa1e3b9fae..16c0cf844d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9124,7 +9124,6 @@ dependencies = [ "frame-system-benchmarking 27.0.0", "frame-system-rpc-runtime-api 25.0.0", "frame-try-runtime 0.33.0", - "hex-literal", "log", "pallet-asset-tx-payment 27.0.0", "pallet-assets 28.0.0", diff --git a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml index 792f3d8bc4..83c464ba45 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml @@ -35,6 +35,3 @@ integration-tests-common = { path = "../../common" } asset-hub-kusama-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-kusama" } kusama-runtime = { package = "staging-kusama-runtime", path = "../../../../relay/kusama" } system-parachains-constants = { path = "../../../../system-parachains/constants" } - -[features] -runtime-benchmarks = [] \ No newline at end of file diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml index ff2500dd6d..1a851f7b9c 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml @@ -32,7 +32,4 @@ emulated-chains = { path = "../../chains" } integration-tests-common = { path = "../../common" } asset-hub-polkadot-runtime = { path = "../../../../system-parachains/asset-hubs/asset-hub-polkadot" } polkadot-runtime = { path = "../../../../relay/polkadot" } -system-parachains-constants = { path = "../../../../system-parachains/constants" } - -[features] -runtime-benchmarks = [] \ No newline at end of file +system-parachains-constants = { path = "../../../../system-parachains/constants" } \ No newline at end of file diff --git a/integration-tests/emulated/chains/Cargo.toml b/integration-tests/emulated/chains/Cargo.toml index a99a224673..96dee2b31d 100644 --- a/integration-tests/emulated/chains/Cargo.toml +++ b/integration-tests/emulated/chains/Cargo.toml @@ -41,8 +41,3 @@ bridge-hub-polkadot-runtime = { path = "../../../system-parachains/bridge-hubs/b bridge-hub-kusama-runtime = { path = "../../../system-parachains/bridge-hubs/bridge-hub-kusama" } # TODO: replace with `emulated-integration-tests-common@X.Y.Z` from `polkadot-sdk` integration-tests-common = { path = "../common" } - -[features] -runtime-benchmarks = [ - "penpal-runtime/runtime-benchmarks", -] \ No newline at end of file From fe79e5f18902f8f051b13f63dc8b195bd0379808 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 19 Feb 2024 13:20:50 +0100 Subject: [PATCH 6/7] Applied patched *test-utils deps (because of runtime-benchmarks feature propagation) --- Cargo.lock | 13 ++++++------- .../emulated/assets/asset-hub-kusama/Cargo.toml | 2 +- .../emulated/assets/asset-hub-polkadot/Cargo.toml | 2 +- integration-tests/emulated/common/Cargo.toml | 2 +- .../asset-hubs/asset-hub-kusama/Cargo.toml | 4 ++-- .../asset-hubs/asset-hub-polkadot/Cargo.toml | 4 ++-- .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 3 ++- .../bridge-hubs/bridge-hub-polkadot/Cargo.toml | 3 ++- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16c0cf844d..d23d40659d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -627,9 +627,9 @@ dependencies = [ [[package]] name = "asset-test-utils" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e667143b26882e0f67cf028814d46f92671655085e47604cc0e0b62579fee24" +checksum = "dbe1d074264d2de1e1a228f9226159bccf9d03ad2e53fc88d2e037804756d480" dependencies = [ "assets-common", "cumulus-pallet-parachain-system 0.6.0", @@ -1467,9 +1467,9 @@ dependencies = [ [[package]] name = "bridge-hub-test-utils" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d744617b60464166d7d4fbe859164f8dc4f22e096ce386d37afcc3fe157e4a9" +checksum = "5a97535e02f211094d454027af30288a1e5fb43075344354430cefc418e3266e" dependencies = [ "asset-test-utils", "bp-header-chain", @@ -8883,11 +8883,10 @@ dependencies = [ [[package]] name = "parachains-runtimes-test-utils" -version = "6.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34682787ee935f35aa45044637f9557c0b313d91453b41016724574e6193f493" +checksum = "ed49cba62c882e6261cc37d27f53ca84c9aa0605211b7ea2aafdfea888b63f23" dependencies = [ - "assets-common", "cumulus-pallet-parachain-system 0.6.0", "cumulus-pallet-xcmp-queue 0.6.0", "cumulus-primitives-core 0.6.0", diff --git a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml b/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml index 83c464ba45..45cce3d4a5 100644 --- a/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/assets/asset-hub-kusama/Cargo.toml @@ -27,7 +27,7 @@ pallet-xcm = { version = "6.0.0" } # Cumulus parachains-common = { version = "6.0.0" } xcm-emulator = { version = "0.4.0" } -asset-test-utils = { version = "6.0.0" } +asset-test-utils = { version = "6.0.1" } # Local emulated-chains = { path = "../../chains" } diff --git a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml b/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml index 1a851f7b9c..e96817ef65 100644 --- a/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/assets/asset-hub-polkadot/Cargo.toml @@ -25,7 +25,7 @@ pallet-xcm = { version = "6.0.0" } # Cumulus parachains-common = { version = "6.0.0" } xcm-emulator = { version = "0.4.0" } -asset-test-utils = { version = "6.0.0" } +asset-test-utils = { version = "6.0.1" } # Local emulated-chains = { path = "../../chains" } diff --git a/integration-tests/emulated/common/Cargo.toml b/integration-tests/emulated/common/Cargo.toml index e1c9c700b2..92154b7f10 100644 --- a/integration-tests/emulated/common/Cargo.toml +++ b/integration-tests/emulated/common/Cargo.toml @@ -35,7 +35,7 @@ cumulus-primitives-core = { version = "0.6.0" } xcm-emulator = { version = "0.4.0" } cumulus-pallet-xcmp-queue = { version = "0.6.0" } cumulus-pallet-parachain-system = { features = ["parameterized-consensus-hook",] , version = "0.6.0" } -asset-test-utils = { version = "6.0.0" } +asset-test-utils = { version = "6.0.1" } cumulus-pallet-dmp-queue = { version = "0.6.0" } # Bridges diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index 5b43559fbd..0ce737bc14 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -95,8 +95,8 @@ assets-common = { default-features = false , version = "0.6.0" } pallet-xcm-bridge-hub-router = { default-features = false , version = "0.4.0" } [dev-dependencies] -asset-test-utils = { version = "6.0.0" } -parachains-runtimes-test-utils = { version = "6.0.0" } +asset-test-utils = { version = "6.0.1" } +parachains-runtimes-test-utils = { version = "6.0.1" } sp-io = { version = "29.0.0" } [build-dependencies] diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml index 63a87cbe66..70c5d89ca0 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-polkadot/Cargo.toml @@ -91,8 +91,8 @@ pallet-xcm-bridge-hub-router = { default-features = false , version = "0.4.0" } [dev-dependencies] hex-literal = "0.4.1" -asset-test-utils = { version = "6.0.0" } -parachains-runtimes-test-utils = { version = "6.0.0" } +asset-test-utils = { version = "6.0.1" } +parachains-runtimes-test-utils = { version = "6.0.1" } sp-io = { version = "29.0.0" } [build-dependencies] diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index fd17197658..244988223a 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -100,7 +100,7 @@ pallet-bridge-relayers = { default-features = false , version = "0.6.0" } pallet-xcm-bridge-hub = { default-features = false , version = "0.1.0" } [dev-dependencies] -bridge-hub-test-utils = { version = "0.6.0" } +bridge-hub-test-utils = { version = "0.6.1" } bridge-runtime-common = { version = "0.6.0", features = ["integrity-test"] } sp-keyring = { version = "30.0.0" } static_assertions = { version = "1.1.0" } @@ -187,6 +187,7 @@ std = [ ] runtime-benchmarks = [ + "bridge-hub-test-utils/runtime-benchmarks", "bridge-runtime-common/runtime-benchmarks", "cumulus-pallet-dmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 4303c1ee59..9fdb15cf52 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -100,7 +100,7 @@ pallet-bridge-relayers = { default-features = false , version = "0.6.0" } pallet-xcm-bridge-hub = { default-features = false , version = "0.1.0" } [dev-dependencies] -bridge-hub-test-utils = { version = "0.6.0" } +bridge-hub-test-utils = { version = "0.6.1" } bridge-runtime-common = { version = "0.6.0", features = ["integrity-test"] } sp-keyring = { version = "30.0.0" } static_assertions = { version = "1.1.0" } @@ -187,6 +187,7 @@ std = [ ] runtime-benchmarks = [ + "bridge-hub-test-utils/runtime-benchmarks", "bridge-runtime-common/runtime-benchmarks", "cumulus-pallet-dmp-queue/runtime-benchmarks", "cumulus-pallet-parachain-system/runtime-benchmarks", From cad0855231d6020edf428af9b5846939c551ddcc Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 19 Feb 2024 15:13:45 +0100 Subject: [PATCH 7/7] Update .github/workflows/test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 479a150f47..2f8b9d48a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: echo $TASKS echo "itest=$TASKS" >> $GITHUB_OUTPUT - runtime: + runtime-test: needs: [ runtime-matrix ] continue-on-error: true runs-on: ubuntu-22.04