From 1db4edf32b91bdfdb5b64097f82356f96e4d654f Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:59:18 +0100 Subject: [PATCH 01/11] Bump tarpaulin version For test coverage --- .github/workflows/coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index ee1b2ef35c..231ac5bda8 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -46,8 +46,8 @@ jobs: - name: Run all tests & Generate report uses: actions-rs/tarpaulin@v0.1 with: - version: 0.22.0 - args: '--workspace --features try-runtime,runtime-benchmarks -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs precompiles/utils/*' + version: 0.31.0 + args: '--workspace --features try-runtime,runtime-benchmarks -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs' out-type: Xml - name: Code Coverage Summary Report From 28cf6ec6e49d7ca7b4ac85f16d38c0543c3a7346 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:39:49 +0100 Subject: [PATCH 02/11] Remove deprecated actions-rs/tarpaulin --- .github/workflows/coverage.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 231ac5bda8..cdfdf0fecb 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,12 +43,21 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler + - name: Install Tarpaulin v0.31.4 + run: | + curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz + tar -xvzf tarpaulin.tar.gz + chmod +x cargo-tarpaulin + sudo mv cargo-tarpaulin /usr/local/bin/ + - name: Run all tests & Generate report - uses: actions-rs/tarpaulin@v0.1 - with: - version: 0.31.0 - args: '--workspace --features try-runtime,runtime-benchmarks -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs' - out-type: Xml + run: | + cargo tarpaulin \ + --workspace \ + --features try-runtime,runtime-benchmarks \ + -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests \ + --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs \ + --out Xml - name: Code Coverage Summary Report uses: irongut/CodeCoverageSummary@v1.2.0 From 553df21e95e72c5609051817bd3430dd14dd5474 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 11:38:11 +0100 Subject: [PATCH 03/11] fix: '--exclude-files' flag seems not working, downgrading version --- .github/workflows/coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index cdfdf0fecb..bea65c5c8d 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,9 +43,9 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler - - name: Install Tarpaulin v0.31.4 + - name: Install Tarpaulin v0.31.3 run: | - curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz + curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.3/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz tar -xvzf tarpaulin.tar.gz chmod +x cargo-tarpaulin sudo mv cargo-tarpaulin /usr/local/bin/ From 147cf9dcba7f08bd12000725cee8a04cf396b085 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:58:25 +0100 Subject: [PATCH 04/11] Testing with multiple flags --- .github/workflows/coverage.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index bea65c5c8d..cb95f1b8eb 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,9 +43,9 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler - - name: Install Tarpaulin v0.31.3 + - name: Install Tarpaulin v0.31.4 run: | - curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.3/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz + curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz tar -xvzf tarpaulin.tar.gz chmod +x cargo-tarpaulin sudo mv cargo-tarpaulin /usr/local/bin/ @@ -55,8 +55,19 @@ jobs: cargo tarpaulin \ --workspace \ --features try-runtime,runtime-benchmarks \ - -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests \ - --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs \ + --exclude astar-collator \ + --exclude xcm-tools \ + --exclude local-runtime \ + --exclude shibuya-runtime \ + --exclude shiden-runtime \ + --exclude astar-runtime \ + integration-tests \ + --exclude-files vendor/* \ + --exclude-files bin/* \ + --exclude-files runtime/* \ + --exclude-files tests/* \ + --exclude-files **/mock.rs \ + --exclude-files **/weights.rs \ --out Xml - name: Code Coverage Summary Report From b82e47f66be3cdc12ede52479c35899333922061 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:43:14 +0100 Subject: [PATCH 05/11] Update rust-toolchain.toml --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a03f6dbfcb..78fa5b92e8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.77.0" +channel = "1.78.0" components = ["rust-src", "rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal" From cd662dbab62fc6d77acf4eef4736ab0563e7ef14 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:02:46 +0100 Subject: [PATCH 06/11] Update coverage.yaml --- .github/workflows/coverage.yaml | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index cb95f1b8eb..74563b8109 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,32 +43,13 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler - - name: Install Tarpaulin v0.31.4 + - name: Install Tarpaulin v0.31.4 and Generate Report run: | - curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz - tar -xvzf tarpaulin.tar.gz - chmod +x cargo-tarpaulin - sudo mv cargo-tarpaulin /usr/local/bin/ - - - name: Run all tests & Generate report - run: | - cargo tarpaulin \ - --workspace \ - --features try-runtime,runtime-benchmarks \ - --exclude astar-collator \ - --exclude xcm-tools \ - --exclude local-runtime \ - --exclude shibuya-runtime \ - --exclude shiden-runtime \ - --exclude astar-runtime \ - integration-tests \ - --exclude-files vendor/* \ - --exclude-files bin/* \ - --exclude-files runtime/* \ - --exclude-files tests/* \ - --exclude-files **/mock.rs \ - --exclude-files **/weights.rs \ - --out Xml + curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz && \ + tar -xvzf tarpaulin.tar.gz && \ + chmod +x cargo-tarpaulin && \ + sudo mv cargo-tarpaulin /usr/local/bin/ && \ + cargo tarpaulin --workspace --features try-runtime,runtime-benchmarks --exclude astar-collator --exclude xcm-tools --exclude local-runtime --exclude shibuya-runtime --exclude shiden-runtime --exclude astar-runtime integration-tests --exclude-files vendor/* --exclude-files bin/* --exclude-files runtime/* --exclude-files tests/* --exclude-files **/mock.rs --exclude-files **/weights.rs --out Xml - name: Code Coverage Summary Report uses: irongut/CodeCoverageSummary@v1.2.0 From 9171964d0b5d99eab8c4a1a861589426722f3bb4 Mon Sep 17 00:00:00 2001 From: Dino Pacandi Date: Fri, 17 Jan 2025 12:18:16 +0100 Subject: [PATCH 07/11] Fix --- .github/workflows/coverage.yaml | 16 ++++++++++------ tarpaulin.toml | 13 +++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 tarpaulin.toml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 74563b8109..10503e7d0e 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,13 +43,17 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler - - name: Install Tarpaulin v0.31.4 and Generate Report + - name: Install Tarpaulin run: | - curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz && \ - tar -xvzf tarpaulin.tar.gz && \ - chmod +x cargo-tarpaulin && \ - sudo mv cargo-tarpaulin /usr/local/bin/ && \ - cargo tarpaulin --workspace --features try-runtime,runtime-benchmarks --exclude astar-collator --exclude xcm-tools --exclude local-runtime --exclude shibuya-runtime --exclude shiden-runtime --exclude astar-runtime integration-tests --exclude-files vendor/* --exclude-files bin/* --exclude-files runtime/* --exclude-files tests/* --exclude-files **/mock.rs --exclude-files **/weights.rs --out Xml + curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz + tar -xvzf tarpaulin.tar.gz + chmod +x cargo-tarpaulin + sudo mv cargo-tarpaulin $HOME/.cargo/bin + cargo tarpaulin --version + + - name: Run Tarpaulin + run: | + cargo tarpaulin --features try-runtime,runtime-benchmarks - name: Code Coverage Summary Report uses: irongut/CodeCoverageSummary@v1.2.0 diff --git a/tarpaulin.toml b/tarpaulin.toml new file mode 100644 index 0000000000..0e07cb86b6 --- /dev/null +++ b/tarpaulin.toml @@ -0,0 +1,13 @@ +[default-astar] + +name = "default-astar" +manifest-path = "./Cargo.toml" + +workspace = true +out = ["Xml"] + +# List of packages to exclude from testing. +exclude = ["astar-collator", "xcm-tools", "local-runtime", "shibuya-runtime", "shiden-runtime", "astar-runtime", "integration-tests"] + +# List of file paths to exclude from testing. +exclude-files = ["vendor/*", "bin/*", "runtime/*", "tests/*", "**/mock.rs", "**/weights.rs"] From c7b4f118140f43c213fc40f0799f8e5cc58b6862 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:56:56 +0100 Subject: [PATCH 08/11] Revert "Update rust-toolchain.toml" This reverts commit b82e47f66be3cdc12ede52479c35899333922061. --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 78fa5b92e8..a03f6dbfcb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.78.0" +channel = "1.77.0" components = ["rust-src", "rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] profile = "minimal" From 2631e5d6c5a79a71c92b7938ab093e676fc6b989 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:43:18 +0100 Subject: [PATCH 09/11] Update .github/workflows/coverage.yaml Co-authored-by: Ermal Kaleci --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 10503e7d0e..41c0323218 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -46,7 +46,7 @@ jobs: - name: Install Tarpaulin run: | curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz - tar -xvzf tarpaulin.tar.gz + tar -zxvf tarpaulin.tar.gz -C $HOME/.cargo/bin chmod +x cargo-tarpaulin sudo mv cargo-tarpaulin $HOME/.cargo/bin cargo tarpaulin --version From b7509b57f23fb5025564d6dff9ebecdb324cd871 Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:52:08 +0100 Subject: [PATCH 10/11] Update coverage.yaml --- .github/workflows/coverage.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 41c0323218..2a7620fcfe 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -47,8 +47,6 @@ jobs: run: | curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz tar -zxvf tarpaulin.tar.gz -C $HOME/.cargo/bin - chmod +x cargo-tarpaulin - sudo mv cargo-tarpaulin $HOME/.cargo/bin cargo tarpaulin --version - name: Run Tarpaulin From e592f8ff8a2c2a19944be6bacfd26c7f8620208a Mon Sep 17 00:00:00 2001 From: Igor Papandinas <26460174+ipapandinas@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:56:28 +0100 Subject: [PATCH 11/11] Add TODO comment --- .github/workflows/coverage.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 2a7620fcfe..91bf3fe813 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -43,6 +43,7 @@ jobs: - name: Install deps run: sudo apt -y install protobuf-compiler + # TODO: Use `cargo install` with a specific version during the next PolkadotSDK uplift and Rust toolchain version upgrade. - name: Install Tarpaulin run: | curl -L -o tarpaulin.tar.gz https://github.com/xd009642/tarpaulin/releases/download/0.31.4/cargo-tarpaulin-x86_64-unknown-linux-gnu.tar.gz