From b1c3a75a01f75aff6a948ab0766219243b73c917 Mon Sep 17 00:00:00 2001 From: Abhi Agarwal Date: Sun, 14 Sep 2025 21:55:12 -0400 Subject: [PATCH 1/3] Use cargo nextest to speed up runs Signed-off-by: Abhi Agarwal --- .config/nextest.toml | 2 ++ .github/workflows/ci.yml | 31 ++++++++++++++----------------- AGENTS.md | 4 ++-- justfile | 18 ++++++++++++++++++ 4 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 .config/nextest.toml create mode 100644 justfile diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..bd886b4d5 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,2 @@ +[profile.no-bigquery] +default-filter = "not (package(etl-destinations) and binary(/bigquery_pipeline/))" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 083eafb0e..029ebb67e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,19 +86,14 @@ jobs: sudo apt-get install libpq-dev -y ./etl-api/scripts/run_migrations.sh + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + - name: Run Tests run: | - cargo test \ - --workspace \ - --all-features \ - --no-fail-fast \ - --exclude etl-destinations \ - && \ - cargo test \ - -p etl-destinations \ - --no-default-features \ - --no-fail-fast \ - --features iceberg + cargo nextest run --all-features --no-fail-fast --profile no-bigquery test-full: name: Tests (Full) @@ -117,6 +112,8 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@1.88.0 + with: + components: llvm-tools-preview - name: Cache Cargo uses: Swatinem/rust-cache@v2 @@ -145,8 +142,10 @@ jobs: sudo apt-get install libpq-dev -y ./etl-api/scripts/run_migrations.sh - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov + - name: Install cargo-llvm-cov and cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov,cargo-nextest - name: Set up BigQuery Credentials run: | @@ -157,10 +156,8 @@ jobs: - name: Generate Code Coverage id: coverage run: | - cargo llvm-cov test \ - --workspace --no-fail-fast \ - --all-features \ - --lcov --output-path lcov.info + cargo llvm-cov nextest --no-fail-fast \ + --all-features --lcov --output-path lcov.info - name: Upload Coverage to Coveralls uses: coverallsapp/github-action@v2 diff --git a/AGENTS.md b/AGENTS.md index 5ff8ff8d9..eb3ecb45b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,8 +6,8 @@ - Tests live per crate (`src` unit tests, `tests` integration); benches in `etl-benchmarks/benches/`. ## Build and Test -- Build: `cargo build --workspace --all-targets --all-features`. -- Lint/format: `cargo fmt`; `cargo clippy --all-targets --all-features -- -D warnings`. +- Build: `just build`. +- Lint/format: `just fmt; just lint`. - Use `ENABLE_TRACING=1` when running integration tests to see the logs. - Use `RUST_LOG=[log-level]` if you need to see the logs with a specific log level. diff --git a/justfile b/justfile new file mode 100644 index 000000000..76ab2710c --- /dev/null +++ b/justfile @@ -0,0 +1,18 @@ +build: + cargo build --workspace --all-targets --all-features + +fmt: + cargo fmt + +lint: + cargo clippy --all-targets --all-features -- -D warnings + +test: + cargo nextest run --all-features + +test-nobigquery: + cargo nextest run --all-features --profile no-bigquery + +install-tools: + cargo install cargo-nextest --locked + cargo install just --locked From 710fd77b5efc84c363b066e98df3952f9e4b765f Mon Sep 17 00:00:00 2001 From: Abhi Agarwal Date: Sun, 14 Sep 2025 22:06:25 -0400 Subject: [PATCH 2/3] add retries to test for nondeterministic tests Signed-off-by: Abhi Agarwal --- .config/nextest.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/nextest.toml b/.config/nextest.toml index bd886b4d5..d015739f6 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -1,2 +1,5 @@ +[profile.default] +retries = 2 + [profile.no-bigquery] default-filter = "not (package(etl-destinations) and binary(/bigquery_pipeline/))" From 7c6550b4a757a5813ace18bff2813213b5544ce0 Mon Sep 17 00:00:00 2001 From: Abhi Agarwal Date: Sun, 14 Sep 2025 22:16:56 -0400 Subject: [PATCH 3/3] Add slow timeout Signed-off-by: Abhi Agarwal --- .config/nextest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nextest.toml b/.config/nextest.toml index d015739f6..d0cc0d530 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -1,5 +1,6 @@ [profile.default] retries = 2 +slow-timeout = { period = "15s", terminate-after = 4 } [profile.no-bigquery] default-filter = "not (package(etl-destinations) and binary(/bigquery_pipeline/))"