From 999977f33ce3fc0aaa718dfd4a0f353f22edfa1e Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Jun 2019 10:14:44 +0200 Subject: [PATCH 1/9] Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. --- scripts/gitlab/test-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index 6a3a1f0ac80..0306e4cfbd8 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,4 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +RUSTFLAGS="-C opt-level=3" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS From ba1ef0b7bbb5dea38a600b2f7ffca3850c91bc88 Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Jun 2019 10:35:33 +0200 Subject: [PATCH 2/9] Remove unused profile settings --- Cargo.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7b75eda49a4..1a5e32d1011 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,12 +117,6 @@ path = "parity/lib.rs" path = "parity/main.rs" name = "parity" -[profile.dev] - -[profile.test] -lto = false -opt-level = 3 # makes tests slower to compile, but faster to run - [profile.release] debug = false lto = true From d654d255fbf5e7f825dee96842d97d04ca96f28c Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Jun 2019 15:08:37 +0200 Subject: [PATCH 3/9] Maybe like this? --- scripts/gitlab/test-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index 0306e4cfbd8..ef739b58f64 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,4 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -RUSTFLAGS="-C opt-level=3" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C incremental=false -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS From 391e9bcc8b918ddf332193303c8e56b24ef6528c Mon Sep 17 00:00:00 2001 From: David Palm Date: Wed, 5 Jun 2019 15:48:59 +0200 Subject: [PATCH 4/9] Turn off incremental compilation --- scripts/gitlab/test-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index ef739b58f64..abf758ba4e1 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,4 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C incremental=false -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS From 49187800bac2079b6947343f0d437229a3be1747 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Jun 2019 18:11:03 +0200 Subject: [PATCH 5/9] Remove colors; try again with overflow-checks on --- scripts/gitlab/test-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index b86bb2242ae..feb9b189603 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,4 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS From 7c67c35008cf70b4ab2aad38cf76a6ba9c0bc313 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Jun 2019 18:17:58 +0200 Subject: [PATCH 6/9] Use quiet CI machine --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33cfbd9d9fb..35b48bea8b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -127,6 +127,8 @@ test-linux: script: - ./scripts/gitlab/test-linux.sh stable - sccache -s + tags: + - qa test-linux-beta: stage: build From 0be77dfca663a5ec5ff93405080bde9ad6fb3390 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Jun 2019 20:43:06 +0200 Subject: [PATCH 7/9] Turn overflow checking back on --- scripts/gitlab/test-linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index feb9b189603..87c847bd4e0 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,4 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS From 6c7416d5553c07b7dca5525ad0d81bdd62af6e01 Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Jun 2019 21:59:13 +0200 Subject: [PATCH 8/9] Be explicit about what options we use --- scripts/gitlab/test-linux.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index 87c847bd4e0..aac007ea63e 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,5 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS +# Why are we using RUSTFLAGS? See https://github.com/paritytech/parity-ethereum/pull/10719 +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=on -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS From 9daf394fb16dca9f5771b8bd4f9d916aeab90bfa Mon Sep 17 00:00:00 2001 From: David Palm Date: Thu, 6 Jun 2019 21:59:52 +0200 Subject: [PATCH 9/9] Remove "quiet machine" override --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35b48bea8b4..33cfbd9d9fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -127,8 +127,6 @@ test-linux: script: - ./scripts/gitlab/test-linux.sh stable - sccache -s - tags: - - qa test-linux-beta: stage: build