From 3b6597e0edb5a5cd713da84fa5d00671d4df086b Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Tue, 21 Jul 2020 16:55:54 +0200 Subject: [PATCH] "cargo test" jobs optimization (#6606) * change (ci): 3 jobs in 1 decreases concurrency and is more effectiv; w/o release it's ~20% faster, but needs testing on prod; wasmtest tests are already running within cargo test --workspace * fix (test): these ones were failing on nightly * save: cargo profiles [skip ci] * change (ci): one test to run them all * change (ci): rebase * Revert "change (ci): rebase" This reverts commit 8a6b7ea043a460bf71526ccaa4c7a68899a3b2bc. * fix (config): fix manifest * change (ci): bench release --- substrate/.gitlab-ci.yml | 61 ++----------------- .../support/test/tests/decl_module_ui.rs | 2 +- .../support/test/tests/decl_storage_ui.rs | 1 + 3 files changed, 7 insertions(+), 57 deletions(-) diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index b8e66d9eb7..1c9c2e5139 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -221,13 +221,15 @@ test-linux-stable: &test-linux <<: *default-vars # Enable debug assertions since we are running optimized builds for testing # but still want to have debug assertions. - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" - RUST_BACKTRACE: 1 + RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" + RUST_BACKTRACE: 1 + WASM_BUILD_NO_COLOR: 1 except: variables: - $DEPLOY_TAG script: - - WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked + # this job runs all tests in former runtime-benchmarks, frame-staking and wasmtime tests + - time cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml - sccache -s unleash-check: @@ -240,24 +242,6 @@ unleash-check: - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} -test-frame-staking: - # into one job - stage: test - <<: *docker-env - variables: - <<: *default-vars - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd frame/staking/ - - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features "std" - - sccache -s - test-frame-examples-compile-to-wasm: # into one job stage: test @@ -278,41 +262,6 @@ test-frame-examples-compile-to-wasm: - cargo +nightly build --target=wasm32-unknown-unknown --no-default-features - sccache -s -test-wasmtime: - stage: test - <<: *docker-env - variables: - <<: *default-vars - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd client/executor - - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime - - sccache -s - -test-runtime-benchmarks: - # into one job - stage: test - <<: *docker-env - variables: - <<: *default-vars - # Enable debug assertions since we are running optimized builds for testing - # but still want to have debug assertions. - RUSTFLAGS: -Cdebug-assertions=y - RUST_BACKTRACE: 1 - except: - variables: - - $DEPLOY_TAG - script: - - cd bin/node/cli - - WASM_BUILD_NO_COLOR=1 time cargo test --workspace --release --verbose --features runtime-benchmarks - - sccache -s - test-linux-stable-int: <<: *test-linux except: diff --git a/substrate/frame/support/test/tests/decl_module_ui.rs b/substrate/frame/support/test/tests/decl_module_ui.rs index 90d105e7cf..7df64bc52f 100644 --- a/substrate/frame/support/test/tests/decl_module_ui.rs +++ b/substrate/frame/support/test/tests/decl_module_ui.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//#[rustversion::attr(not(stable), ignore)] +#[rustversion::attr(not(stable), ignore)] #[test] fn decl_module_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. diff --git a/substrate/frame/support/test/tests/decl_storage_ui.rs b/substrate/frame/support/test/tests/decl_storage_ui.rs index d771b6e0ee..56529d62c2 100644 --- a/substrate/frame/support/test/tests/decl_storage_ui.rs +++ b/substrate/frame/support/test/tests/decl_storage_ui.rs @@ -15,6 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#[rustversion::attr(not(stable), ignore)] #[test] fn decl_storage_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries.