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

Commit aa36bf2

Browse files
authored
"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 8a6b7ea. * fix (config): fix manifest * change (ci): bench release
1 parent 056879f commit aa36bf2

File tree

3 files changed

+7
-57
lines changed

3 files changed

+7
-57
lines changed

.gitlab-ci.yml

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,15 @@ test-linux-stable: &test-linux
221221
<<: *default-vars
222222
# Enable debug assertions since we are running optimized builds for testing
223223
# but still want to have debug assertions.
224-
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
225-
RUST_BACKTRACE: 1
224+
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
225+
RUST_BACKTRACE: 1
226+
WASM_BUILD_NO_COLOR: 1
226227
except:
227228
variables:
228229
- $DEPLOY_TAG
229230
script:
230-
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked
231+
# this job runs all tests in former runtime-benchmarks, frame-staking and wasmtime tests
232+
- time cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml
231233
- sccache -s
232234

233235
unleash-check:
@@ -240,24 +242,6 @@ unleash-check:
240242
- cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS}
241243
- cargo unleash check ${CARGO_UNLEASH_PKG_DEF}
242244

243-
test-frame-staking:
244-
# into one job
245-
stage: test
246-
<<: *docker-env
247-
variables:
248-
<<: *default-vars
249-
# Enable debug assertions since we are running optimized builds for testing
250-
# but still want to have debug assertions.
251-
RUSTFLAGS: -Cdebug-assertions=y
252-
RUST_BACKTRACE: 1
253-
except:
254-
variables:
255-
- $DEPLOY_TAG
256-
script:
257-
- cd frame/staking/
258-
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features "std"
259-
- sccache -s
260-
261245
test-frame-examples-compile-to-wasm:
262246
# into one job
263247
stage: test
@@ -278,41 +262,6 @@ test-frame-examples-compile-to-wasm:
278262
- cargo +nightly build --target=wasm32-unknown-unknown --no-default-features
279263
- sccache -s
280264

281-
test-wasmtime:
282-
stage: test
283-
<<: *docker-env
284-
variables:
285-
<<: *default-vars
286-
# Enable debug assertions since we are running optimized builds for testing
287-
# but still want to have debug assertions.
288-
RUSTFLAGS: -Cdebug-assertions=y
289-
RUST_BACKTRACE: 1
290-
except:
291-
variables:
292-
- $DEPLOY_TAG
293-
script:
294-
- cd client/executor
295-
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime
296-
- sccache -s
297-
298-
test-runtime-benchmarks:
299-
# into one job
300-
stage: test
301-
<<: *docker-env
302-
variables:
303-
<<: *default-vars
304-
# Enable debug assertions since we are running optimized builds for testing
305-
# but still want to have debug assertions.
306-
RUSTFLAGS: -Cdebug-assertions=y
307-
RUST_BACKTRACE: 1
308-
except:
309-
variables:
310-
- $DEPLOY_TAG
311-
script:
312-
- cd bin/node/cli
313-
- WASM_BUILD_NO_COLOR=1 time cargo test --workspace --release --verbose --features runtime-benchmarks
314-
- sccache -s
315-
316265
test-linux-stable-int:
317266
<<: *test-linux
318267
except:

frame/support/test/tests/decl_module_ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18-
//#[rustversion::attr(not(stable), ignore)]
18+
#[rustversion::attr(not(stable), ignore)]
1919
#[test]
2020
fn decl_module_ui() {
2121
// As trybuild is using `cargo check`, we don't need the real WASM binaries.

frame/support/test/tests/decl_storage_ui.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
1717

18+
#[rustversion::attr(not(stable), ignore)]
1819
#[test]
1920
fn decl_storage_ui() {
2021
// As trybuild is using `cargo check`, we don't need the real WASM binaries.

0 commit comments

Comments
 (0)