From 58ec3cd9c255cbf8600ebc1188bf4ccfaace9a0a Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:26:08 +0300 Subject: [PATCH 01/32] split build and test --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3af676bfb..ea31615e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,12 +47,19 @@ jobs: - name: Enable Rust Caching uses: Swatinem/rust-cache@v2 - - name: Test + - name: Build # Build test binary with `testing` feature, which requires `hotshot_example` config run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo build --locked --bin diff-test --release + timeout-minutes: 90 + + - name: Test + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" cargo test --locked --release --workspace --all-features --no-run cargo test --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture timeout-minutes: 90 From 8e223df52516b4ae81499151de568b73a1df6119 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:32:35 +0300 Subject: [PATCH 02/32] add nextest this way we can compare --- .github/workflows/nextest.yml | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/nextest.yml diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml new file mode 100644 index 000000000..89e661320 --- /dev/null +++ b/.github/workflows/nextest.yml @@ -0,0 +1,67 @@ +name: NexTest + +on: + push: + branches: + - main + - release-* + tags: + # YYYYMMDD + - "20[0-9][0-9][0-1][0-9][0-3][0-9]*" + schedule: + - cron: "0 0 * * 1" + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + RUST_LOG: info,libp2p=off,node=error + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Fix submodule permissions check + run: | + git config --global --add safe.directory '*' + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Install just command runner + run: | + sudo snap install --edge --classic just + just --version + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Enable Rust Caching + uses: Swatinem/rust-cache@v2 + + - name: Build + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" + cargo build --locked --bin diff-test --release + timeout-minutes: 90 + + - uses: cargo-bins/cargo-binstall@main + + - name: NexTest + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" + cargo nextest --locked --release --workspace --all-features --no-run + cargo nextest --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture + timeout-minutes: 90 From a31ccef770f3144f6b1cc330cb45af54110e0814 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:38:31 +0300 Subject: [PATCH 03/32] add nextest --- .github/workflows/nextest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 89e661320..05b36b497 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -56,6 +56,7 @@ jobs: timeout-minutes: 90 - uses: cargo-bins/cargo-binstall@main + - run: cargo binstall cargo-nextest --secure - name: NexTest # Build test binary with `testing` feature, which requires `hotshot_example` config From 45c3d79ab7896a8bdd7bace704ba492477bf02d6 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:46:57 +0300 Subject: [PATCH 04/32] try again --- .github/workflows/nextest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 05b36b497..e8c7ae396 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -55,10 +55,11 @@ jobs: cargo build --locked --bin diff-test --release timeout-minutes: 90 - - uses: cargo-bins/cargo-binstall@main - - run: cargo binstall cargo-nextest --secure + - uses: taiki-e/install-action@nextest - name: NexTest + env: + CARGO_TERM_COLOR: always # Build test binary with `testing` feature, which requires `hotshot_example` config run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" From 4190d16f9cc2ac58c2f4e1a94ae57bb9886b2a40 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:52:25 +0300 Subject: [PATCH 05/32] apparently nextest doesn't not have `--locked` param --- .github/workflows/nextest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index e8c7ae396..959786027 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -64,6 +64,6 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest --locked --release --workspace --all-features --no-run - cargo nextest --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture + cargo nextest --release --workspace --all-features --no-run + cargo nextest --release --workspace --all-features --verbose -- --test-threads 1 --nocapture timeout-minutes: 90 From 25de9eab9cd91e471273b795bb56eaef4e5e5fdd Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 05:58:44 +0300 Subject: [PATCH 06/32] fix command --- .github/workflows/nextest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 959786027..bb7d637d8 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -64,6 +64,6 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest --release --workspace --all-features --no-run - cargo nextest --release --workspace --all-features --verbose -- --test-threads 1 --nocapture + cargo nextest run --locked --release --workspace --all-features --no-run + cargo nextest run --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture timeout-minutes: 90 From b3e14f0bf28ea19383768d2d9d4cff7ee7089aea Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 06:18:41 +0300 Subject: [PATCH 07/32] fix --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index bb7d637d8..eb816f5c2 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -65,5 +65,5 @@ jobs: export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo nextest run --locked --release --workspace --all-features --no-run - cargo nextest run --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture + cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 timeout-minutes: 90 From 4d3e749553fe22a3627b2f63defe905093ef6f5c Mon Sep 17 00:00:00 2001 From: sveitser Date: Tue, 13 Aug 2024 10:45:38 +0200 Subject: [PATCH 08/32] Add nextest to flake.nix --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 777dba371..403c1470a 100644 --- a/flake.nix +++ b/flake.nix @@ -197,6 +197,7 @@ cargo-audit cargo-edit cargo-sort + cargo-nextest typos just fenix.packages.${system}.rust-analyzer From 97f477e0c51efa50f94bbad260715d92f81641bf Mon Sep 17 00:00:00 2001 From: sveitser Date: Tue, 13 Aug 2024 10:45:57 +0200 Subject: [PATCH 09/32] Separate building of tests from running of tests Get more information on how much time we spend on each task to better plan CI runtime optimizations. --- .github/workflows/nextest.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index eb816f5c2..bd965612a 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -53,6 +53,7 @@ jobs: export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo build --locked --bin diff-test --release + cargo nextest run --locked --release --workspace --all-features --no-run timeout-minutes: 90 - uses: taiki-e/install-action@nextest @@ -64,6 +65,5 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --no-run cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 timeout-minutes: 90 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea31615e1..b9b87c9ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,6 +52,7 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" + cargo test --locked --release --workspace --all-features --no-run cargo build --locked --bin diff-test --release timeout-minutes: 90 @@ -60,6 +61,5 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo test --locked --release --workspace --all-features --no-run cargo test --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture timeout-minutes: 90 From 8ef47fa149f99739fd523f06ef7110706be230d6 Mon Sep 17 00:00:00 2001 From: sveitser Date: Tue, 13 Aug 2024 10:51:26 +0200 Subject: [PATCH 10/32] CI: install nextest before using it --- .github/workflows/nextest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index bd965612a..8fbd06a7a 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -22,7 +22,7 @@ env: RUST_LOG: info,libp2p=off,node=error jobs: - test: + nextest: runs-on: ubuntu-latest steps: - name: Fix submodule permissions check @@ -39,6 +39,8 @@ jobs: sudo snap install --edge --classic just just --version + - uses: taiki-e/install-action@nextest + - name: Checkout Repository uses: actions/checkout@v4 with: @@ -56,8 +58,6 @@ jobs: cargo nextest run --locked --release --workspace --all-features --no-run timeout-minutes: 90 - - uses: taiki-e/install-action@nextest - - name: NexTest env: CARGO_TERM_COLOR: always From 5abed7fcaacc0da79b125ac45893ad063392d4c6 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 18:09:12 +0300 Subject: [PATCH 11/32] prefix `slow_` tests --- sequencer/src/bin/espresso-dev-node.rs | 4 ++-- types/src/v0/impls/l1.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sequencer/src/bin/espresso-dev-node.rs b/sequencer/src/bin/espresso-dev-node.rs index 5737ea7c7..3fe2cf927 100644 --- a/sequencer/src/bin/espresso-dev-node.rs +++ b/sequencer/src/bin/espresso-dev-node.rs @@ -541,7 +541,7 @@ mod tests { // - APIs update // - Types (like `Header`) update #[async_std::test] - async fn dev_node_test() { + async fn slow_dev_node_test() { setup_test(); let builder_port = pick_unused_port().unwrap(); @@ -849,7 +849,7 @@ mod tests { } #[async_std::test] - async fn dev_node_multiple_lc_providers_test() { + async fn slow_dev_node_multiple_lc_providers_test() { setup_test(); let builder_port = pick_unused_port().unwrap(); diff --git a/types/src/v0/impls/l1.rs b/types/src/v0/impls/l1.rs index 85e4a9be4..dc5925323 100644 --- a/types/src/v0/impls/l1.rs +++ b/types/src/v0/impls/l1.rs @@ -442,7 +442,7 @@ mod test { } #[async_std::test] - async fn test_wait_for_finalized_block() { + async fn slow_test_wait_for_finalized_block() { setup_test(); let anvil = Anvil::new().block_time(1u32).spawn(); From 4fb32e2195d14914b3d155adee1cd212f3e3f5cb Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 18:33:03 +0300 Subject: [PATCH 12/32] remove just --- .github/workflows/nextest.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 8fbd06a7a..b7c8dbbcb 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -34,11 +34,6 @@ jobs: with: version: nightly - - name: Install just command runner - run: | - sudo snap install --edge --classic just - just --version - - uses: taiki-e/install-action@nextest - name: Checkout Repository From 76117bbe726db456b3958dc58c0fd63d0aeeba48 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 18:34:22 +0300 Subject: [PATCH 13/32] Separate slow tests --- .github/workflows/nextest.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index b7c8dbbcb..d04560a8a 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -60,5 +60,15 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 + cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E '!test(slow_)' + timeout-minutes: 5 + + - name: SlowTest + env: + CARGO_TERM_COLOR: always + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" + cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E 'test(slow_)' timeout-minutes: 90 From 8e91d531667c434ab82763b105252a4a06c507fa Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 19:03:34 +0300 Subject: [PATCH 14/32] remove async flags --- .github/workflows/nextest.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index d04560a8a..758e5cde9 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -18,7 +18,6 @@ concurrency: cancel-in-progress: true env: - RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' RUST_LOG: info,libp2p=off,node=error jobs: From d40f2fa09de00ba7a0e7f13b5096d07d6e9e6edd Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 19:11:04 +0300 Subject: [PATCH 15/32] format --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 758e5cde9..a87244a9f 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -62,7 +62,7 @@ jobs: cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E '!test(slow_)' timeout-minutes: 5 - - name: SlowTest + - name: SlowTest env: CARGO_TERM_COLOR: always # Build test binary with `testing` feature, which requires `hotshot_example` config From c225e4d6905f6cf7b66e0e200f0be183cb229b38 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 19:21:38 +0300 Subject: [PATCH 16/32] put back the flags --- .github/workflows/nextest.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index a87244a9f..ea5a2a0f4 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -18,6 +18,7 @@ concurrency: cancel-in-progress: true env: + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' RUST_LOG: info,libp2p=off,node=error jobs: From 10005c63f2ff2110e749a9a62e411e5d602458e6 Mon Sep 17 00:00:00 2001 From: tbro Date: Tue, 13 Aug 2024 21:53:15 +0300 Subject: [PATCH 17/32] more time for the test --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index ea5a2a0f4..60bc21e8a 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -61,7 +61,7 @@ jobs: export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E '!test(slow_)' - timeout-minutes: 5 + timeout-minutes: 10 - name: SlowTest env: From 762260205ec90a93fbf88871a8b12ccb392b4027 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 01:22:51 +0300 Subject: [PATCH 18/32] reduce slow timeout --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 60bc21e8a..b6cdcd495 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -71,4 +71,4 @@ jobs: export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E 'test(slow_)' - timeout-minutes: 90 + timeout-minutes: 25 From 9d394c35168b04d5b7b1b38338cb7b0d5bcce994 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 01:25:08 +0300 Subject: [PATCH 19/32] add slow_ to test_restart --- sequencer/src/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index fc3791943..ffefacfe2 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -1579,7 +1579,7 @@ mod test { } #[async_std::test] - pub(crate) async fn test_restart() { + pub(crate) async fn slow_test_restart() { setup_test(); const NUM_NODES: usize = 5; From f1796eff80cc4eb6275d0a5df79fbc16911631c1 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 12:09:17 +0300 Subject: [PATCH 20/32] remove --test-threads option --- .github/workflows/nextest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index b6cdcd495..9f6542a54 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -60,7 +60,7 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E '!test(slow_)' + cargo nextest run --locked --release --workspace --all-features --verbose -E '!test(slow_)' timeout-minutes: 10 - name: SlowTest @@ -70,5 +70,5 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --verbose --test-threads 1 -E 'test(slow_)' + cargo nextest run --locked --release --workspace --all-features --verbose -E 'test(slow_)' timeout-minutes: 25 From aed01e95f7928aaba6a6c4731e9b285ba42c7c41 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 12:27:05 +0300 Subject: [PATCH 21/32] add retry --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 9f6542a54..3bc7e9a59 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -60,7 +60,7 @@ jobs: run: | export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --verbose -E '!test(slow_)' + cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)' timeout-minutes: 10 - name: SlowTest From 41278cf14529edbb1b25bfd7c2bfeffebc88c4cd Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 12:58:18 +0300 Subject: [PATCH 22/32] reduce timeout --- .github/workflows/nextest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 3bc7e9a59..ad81ba9f8 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -61,7 +61,7 @@ jobs: export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" export PATH="$PWD/target/release:$PATH" cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)' - timeout-minutes: 10 + timeout-minutes: 5 - name: SlowTest env: From b672cfce56e55b03a426cd9326e325b309db0174 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 12:58:35 +0300 Subject: [PATCH 23/32] Revert "add slow_ to test_restart" This reverts commit 6c0921203d333d777fff509b507376d26a7959da. --- sequencer/src/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer/src/api.rs b/sequencer/src/api.rs index ffefacfe2..fc3791943 100644 --- a/sequencer/src/api.rs +++ b/sequencer/src/api.rs @@ -1579,7 +1579,7 @@ mod test { } #[async_std::test] - pub(crate) async fn slow_test_restart() { + pub(crate) async fn test_restart() { setup_test(); const NUM_NODES: usize = 5; From 284d97f8881e96b600dc48811a3d0719520e7fea Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 13:18:48 +0300 Subject: [PATCH 24/32] move slow tests to own workflow Only run that workflow on push to main (instead of PR) --- .github/workflows/nextest.yml | 10 ------ .github/workflows/slowtest.yaml | 63 +++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/slowtest.yaml diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index ad81ba9f8..727a0c73f 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -62,13 +62,3 @@ jobs: export PATH="$PWD/target/release:$PATH" cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)' timeout-minutes: 5 - - - name: SlowTest - env: - CARGO_TERM_COLOR: always - # Build test binary with `testing` feature, which requires `hotshot_example` config - run: | - export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" - export PATH="$PWD/target/release:$PATH" - cargo nextest run --locked --release --workspace --all-features --verbose -E 'test(slow_)' - timeout-minutes: 25 diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml new file mode 100644 index 000000000..4d48889c8 --- /dev/null +++ b/.github/workflows/slowtest.yaml @@ -0,0 +1,63 @@ +name: SlowEst + +on: + push: + branches: + - main + - release-* + tags: + # YYYYMMDD + - "20[0-9][0-9][0-1][0-9][0-3][0-9]*" + schedule: + - cron: "0 0 * * 1" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + RUST_LOG: info,libp2p=off,node=error + +jobs: + slowest: + runs-on: ubuntu-latest + steps: + - name: Fix submodule permissions check + run: | + git config --global --add safe.directory '*' + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - uses: taiki-e/install-action@nextest + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Enable Rust Caching + uses: Swatinem/rust-cache@v2 + + - name: Build + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" + cargo build --locked --bin diff-test --release + cargo nextest run --locked --release --workspace --all-features --no-run + timeout-minutes: 90 + + - name: SlowEst + env: + CARGO_TERM_COLOR: always + # Build test binary with `testing` feature, which requires `hotshot_example` config + run: | + export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" + export PATH="$PWD/target/release:$PATH" + cargo nextest run --locked --release --workspace --all-features --verbose -E 'test(slow_)' + timeout-minutes: 25 From c8f18a46f8c327382102ac11668fbdfb214920c5 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 13:19:16 +0300 Subject: [PATCH 25/32] remove `slow_` from test_wait_for_finalized_block --- types/src/v0/impls/l1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/src/v0/impls/l1.rs b/types/src/v0/impls/l1.rs index dc5925323..85e4a9be4 100644 --- a/types/src/v0/impls/l1.rs +++ b/types/src/v0/impls/l1.rs @@ -442,7 +442,7 @@ mod test { } #[async_std::test] - async fn slow_test_wait_for_finalized_block() { + async fn test_wait_for_finalized_block() { setup_test(); let anvil = Anvil::new().block_time(1u32).spawn(); From c093376cea8f1236dffc03f197ffcab0f8e89aad Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 13:21:52 +0300 Subject: [PATCH 26/32] remove `test.yml` This will be replaced by `nextest.yml` in before merge. --- .github/workflows/test.yml | 65 -------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index b9b87c9ec..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Test - -on: - push: - branches: - - main - - release-* - tags: - # YYYYMMDD - - "20[0-9][0-9][0-1][0-9][0-3][0-9]*" - schedule: - - cron: "0 0 * * 1" - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' - RUST_LOG: info,libp2p=off,node=error - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Fix submodule permissions check - run: | - git config --global --add safe.directory '*' - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Install just command runner - run: | - sudo snap install --edge --classic just - just --version - - - name: Checkout Repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Enable Rust Caching - uses: Swatinem/rust-cache@v2 - - - name: Build - # Build test binary with `testing` feature, which requires `hotshot_example` config - run: | - export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" - export PATH="$PWD/target/release:$PATH" - cargo test --locked --release --workspace --all-features --no-run - cargo build --locked --bin diff-test --release - timeout-minutes: 90 - - - name: Test - # Build test binary with `testing` feature, which requires `hotshot_example` config - run: | - export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example" - export PATH="$PWD/target/release:$PATH" - cargo test --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture - timeout-minutes: 90 From 087438131e55504d88d4ae866b3f853254bb641c Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 13:48:46 +0300 Subject: [PATCH 27/32] change names from `NexTest` to `Test` --- .github/workflows/nextest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index 727a0c73f..7c14ac3dd 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -1,4 +1,4 @@ -name: NexTest +name: Test on: push: @@ -22,7 +22,7 @@ env: RUST_LOG: info,libp2p=off,node=error jobs: - nextest: + test: runs-on: ubuntu-latest steps: - name: Fix submodule permissions check @@ -53,7 +53,7 @@ jobs: cargo nextest run --locked --release --workspace --all-features --no-run timeout-minutes: 90 - - name: NexTest + - name: Test env: CARGO_TERM_COLOR: always # Build test binary with `testing` feature, which requires `hotshot_example` config From c1cd5f5de93c5dc320796dc2c4a6edd7b0339a50 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 13:49:44 +0300 Subject: [PATCH 28/32] rename nextest.yml -> test.yml --- .github/workflows/{nextest.yml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{nextest.yml => test.yml} (100%) diff --git a/.github/workflows/nextest.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/nextest.yml rename to .github/workflows/test.yml From 39d2e888b70e375be9727249f2dc46ea70617ae9 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 14:20:03 +0300 Subject: [PATCH 29/32] add pull_request We think this will not be required on PR since it is a new workflow. --- .github/workflows/slowtest.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 4d48889c8..420e5df4b 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -10,6 +10,7 @@ on: - "20[0-9][0-9][0-1][0-9][0-3][0-9]*" schedule: - cron: "0 0 * * 1" + pull_request: workflow_dispatch: concurrency: From 5a609dfc9d20643873302fe82f09a443ff710ac8 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 14:22:46 +0300 Subject: [PATCH 30/32] do not cancel job on `main` --- .github/workflows/slowtest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 420e5df4b..1653faa9d 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -15,7 +15,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ !contains(github.ref, 'main')}} env: RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' From a7d14fdaa48aecfe46083c956658bf89dbcb4a85 Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 14:34:38 +0300 Subject: [PATCH 31/32] add just commands --- justfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 18036aff7..ee5042b44 100644 --- a/justfile +++ b/justfile @@ -34,8 +34,15 @@ anvil *args: docker run -p 127.0.0.1:8545:8545 ghcr.io/foundry-rs/foundry:latest "anvil {{args}}" test: - cargo build --bin diff-test --release - cargo test --release --all-features + @echo 'Ommiting slow tests. Use `test-slow` for those. Or `test-all` for all tests.' + cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)' + +test-slow: + @echo 'Only slow tests are included. Use `test` for those deemed not slow. Or `test-all` for all tests.' + cargo nextest run --locked --release --workspace --all-features --verbose -E 'test(slow_)' + +test-all: + cargo nextest run --locked --release --workspace --all-features --verbose clippy: cargo clippy --workspace --all-features --all-targets -- -D warnings From 5494139eeb2a895624d81e6b343b72e37cbffd1e Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 14:38:05 +0300 Subject: [PATCH 32/32] typo --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index ee5042b44..2c2661153 100644 --- a/justfile +++ b/justfile @@ -34,7 +34,7 @@ anvil *args: docker run -p 127.0.0.1:8545:8545 ghcr.io/foundry-rs/foundry:latest "anvil {{args}}" test: - @echo 'Ommiting slow tests. Use `test-slow` for those. Or `test-all` for all tests.' + @echo 'Omitting slow tests. Use `test-slow` for those. Or `test-all` for all tests.' cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)' test-slow: