Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
"cargo test" jobs optimization (#6606)
Browse files Browse the repository at this point in the history
* 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 8a6b7ea.

* fix (config): fix manifest

* change (ci): bench release
  • Loading branch information
TriplEight committed Jul 21, 2020
1 parent 056879f commit aa36bf2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 57 deletions.
61 changes: 5 additions & 56 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/tests/decl_module_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions frame/support/test/tests/decl_storage_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit aa36bf2

Please sign in to comment.