From 2b3024339b1a5f81157af827cde36b19f9ddc505 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 7 Dec 2023 23:18:55 +0100 Subject: [PATCH] [ci/cd] Split Test pipeline according to `runtime-benchmarks` feature (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Based on original [issue](https://github.com/paritytech/ci_cd/issues/864 ) from @gilescope related to the monorepo: > Currently the tests have started to be run with the `runtime-benchmarks` feature enabled ( E.g. https://github.com/paritytech/polkadot-sdk/blob/aabed6757e26e21ce06dd59946a17b72f349185e/.gitlab/pipeline/test.yml#L37 ). This was done so that the autogenerated tests that the benchmark macros create get run (but it seems that we already have a short-benchmark CI job... - do the additional tests give us anything extra? EDIT: the short-benchmarks only test 3 relay chains so not comprehensive enough). > However, this is inherently dangerous as not everything will be in a production like state when it is being tested. > For safety's sake we should be running without the `runtime-benchmarks` feature enabled. Assuming the CI system can take it, we should set up another job that runs the tests with the runtime-benchmarks feature enabled. (if we did not do this we would catch any problems later when the weights are rerun for the runtime release builds). ## Proposed solution Split [test pipeline](https://github.com/polkadot-fellows/runtimes/blob/main/.github/workflows/test.yml#L44) to the two pipelines: - one without `runtime-benchmarks` feature - one with `runtime-benchmarks` feature Co-authored-by: Bastian Köcher --- .github/workflows/test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3c294071f..2672bc2b00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,8 +51,14 @@ jobs: - name: Fetch cache uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0 + - name: Test + run: cargo test --workspace --release --locked -q --features=runtime-metrics,try-runtime + env: + RUSTFLAGS: "-C debug-assertions -D warnings" + SKIP_WASM_BUILD: 1 + - name: Test all features run: cargo test --workspace --release --locked -q --features=runtime-benchmarks,runtime-metrics,try-runtime env: RUSTFLAGS: "-C debug-assertions -D warnings" - SKIP_WASM_BUILD: 1 + SKIP_WASM_BUILD: 1 \ No newline at end of file