diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81dbe2e94..9e7d3c7f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ on: env: CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: "0" + CARGO_PROFILE_DEV_DEBUG: line-tables-only + CARGO_PROFILE_TEST_DEBUG: line-tables-only RUST_BACKTRACE: 1 RUST_LIB_BACKTRACE: 1 @@ -59,8 +62,8 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Clean env run: pixi run clean-env - - name: Build C++ libs + all Rust test binaries - run: pixi run build-cpp && pixi run build-tests + - name: Build C++ libs + run: pixi run build-cpp - name: Run C++ and FFI tests run: pixi run test-cpp - name: Capture runner state on failure @@ -104,8 +107,6 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Clean env run: pixi run clean-env - - name: Build all Rust test binaries - run: pixi run build-tests - name: Run unit tests run: pixi run test-unit - name: Capture runner state on failure @@ -149,8 +150,8 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Clean env run: pixi run clean-env - - name: Build C++ libs (crowdb-diskio subprocess) + all Rust test binaries - run: pixi run build-cpp && pixi run build-tests + - name: Build C++ libs (crowdb-diskio subprocess) + run: pixi run build-cpp - name: Run server tests run: pixi run test-server - name: Capture runner state on failure @@ -307,8 +308,6 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Clean env run: pixi run clean-env - - name: Build all Rust test binaries + crowdb-kv-server - run: pixi run build-tests - name: Build crowdb-rpc-fb-server (for bench rpc e2e test) run: pixi run cmake -S lib/crowdb-rpc -B lib/crowdb-rpc/build -DCMAKE_BUILD_TYPE=Release && pixi run cmake --build lib/crowdb-rpc/build --target crowdb-rpc-fb-server -j - name: Run console tests @@ -355,8 +354,6 @@ jobs: pixi-version: latest - name: Cache cargo + target uses: Swatinem/rust-cache@v2 - - name: Build crowdb-kv-server + crowdb-diskdb binaries - run: pixi run build-tests - name: Install Playwright Chromium (skip if system browser present) working-directory: app/crowdb-web/ui run: | diff --git a/.github/workflows/release-container.yml b/.github/workflows/release-container.yml index d047f2188..cc4efcbda 100644 --- a/.github/workflows/release-container.yml +++ b/.github/workflows/release-container.yml @@ -15,6 +15,10 @@ concurrency: jobs: verify: runs-on: ubuntu-24.04 + env: + CARGO_INCREMENTAL: "0" + CARGO_PROFILE_DEV_DEBUG: line-tables-only + CARGO_PROFILE_TEST_DEBUG: line-tables-only permissions: contents: read outputs: @@ -55,6 +59,12 @@ jobs: env: CROWDB_PREVIEW_TEST_ARTIFACTS: ${{ runner.temp }}/crowdb-preview-artifacts run: pixi run test-single-node-container + - name: Free preview build artifacts before acceptance tests + run: | + pixi run docker image rm crowdb-iceberg-single-node:dev + pixi run docker builder prune --all --force + pixi run cargo clean --release + pixi run df -h / - name: Run S3 client acceptance run: pixi run clean-env && pixi run -e s3-e2e test-boto3-e2e - name: Run Iceberg client acceptance @@ -129,7 +139,9 @@ jobs: name: verified-container-runtime path: target - name: Extract verified runtime files - run: pixi run bash -euc 'mkdir -p target/container-runtime && tar -C target/container-runtime -xzf target/container-runtime.tar.gz' + run: | + pixi run bash -euc 'mkdir -p target/container-runtime && tar -C target/container-runtime -xzf target/container-runtime.tar.gz' + pixi run rm target/container-runtime.tar.gz - uses: docker/login-action@v4 with: username: ${{ vars.DOCKERHUB_USERNAME }} diff --git a/app/crowdb-access-server/tests/iceberg_namespace_sdk_test.rs b/app/crowdb-access-server/tests/iceberg_namespace_sdk_test.rs index ed852053f..0c54ebb0a 100644 --- a/app/crowdb-access-server/tests/iceberg_namespace_sdk_test.rs +++ b/app/crowdb-access-server/tests/iceberg_namespace_sdk_test.rs @@ -158,10 +158,10 @@ async fn official_catalog_continues_through_empty_namespace_pages() { }) .await .unwrap(); - assert_eq!(test.store.scans.load(Ordering::SeqCst), 7); - test.finish().await; assert!( status.success(), "official namespace pagination acceptance failed" ); + assert_eq!(test.store.scans.load(Ordering::SeqCst), 7); + test.finish().await; } diff --git a/doc/working/test.md b/doc/working/test.md index 21e410356..f50a528d8 100644 --- a/doc/working/test.md +++ b/doc/working/test.md @@ -17,7 +17,8 @@ For test strategy, layer scope, and coverage details, see [`design/kv/design-cro ## Current CI Test Design CI uses ten parallel jobs, grouped by runtime requirements. Component tasks in -`pixi.toml` select packages with `--all-targets`; group scripts under +`pixi.toml` select library, binary, and integration test targets with +`--tests`; benchmark targets are excluded. Group scripts under `tools/pixi-tasks/` define execution order. GitHub Actions calls those group tasks. See [tools/README.md](../../tools/README.md) for the tooling map. diff --git a/pixi.toml b/pixi.toml index b6d01cab1..4eb1b0cb2 100644 --- a/pixi.toml +++ b/pixi.toml @@ -152,15 +152,11 @@ profile-write = { cmd = "bash tools/profiling/profile-write.sh", depends-on = [" # ── Test ───────────────────────────────────────────────────────── # Tasks are grouped by CI job (see doc/working/test.md § "Current CI # Test Design"). Each group maps 1:1 to a parallel CI job. Run -# `pixi run build-tests` once before any test task to pre-build all -# Rust test binaries; C++ ctest tasks need `pixi run build-cpp`. +# Each test group builds only its own Rust targets. C++ ctest tasks need +# `pixi run build-cpp`. clean-env = "bash tools/runtime/clean-runtime.sh env" -# Pre-build ALL Rust test binaries + bin targets in one parallel cargo -# invocation. Run this once at the start of a CI job so every subsequent -# `cargo test -p ` step just executes the pre-built binaries -# without recompiling. Also builds the crowdb-kv-server / crowdb-diskdb -# debug binaries that subprocess-spawning tests (crowdb-web, crowdb-console-shared) -# need at target/debug/. +# Optional full-workspace compile check. CI test groups use their component +# tasks to avoid building unrelated test targets on each runner. build-tests = "cargo test --workspace --all-targets --no-run" # Verify every workspace package with tests is assigned to a CI test task. test-task-coverage = "python tools/ci-checks/check-test-task-coverage.py" @@ -173,42 +169,42 @@ test-tree-ct = { cmd = "ctest --test-dir lib/crowdb-tree/build --output-on-failu test-common-ct = { cmd = "lib/crowdb-tree/build/crowdb-common-build/crowdbcommon_tests", depends-on = ["build-cpp"] } test-rpc-ct = { cmd = "ctest --test-dir lib/crowdb-rpc/build --output-on-failure", depends-on = ["build-cpp"] } test-diskio-ct = { cmd = "ctest --test-dir app/crowdb-diskio/build --output-on-failure", depends-on = ["build-cpp"] } -test-tree-ffi = { cmd = "cargo test -p crowdb-tree-ffi --all-targets" } -test-rpc-ffi = { cmd = "cargo test -p crowdb-rpc-ffi --all-targets" } +test-tree-ffi = { cmd = "cargo test -p crowdb-tree-ffi --tests" } +test-rpc-ffi = { cmd = "cargo test -p crowdb-rpc-ffi --tests" } test-cpp = { cmd = "bash tools/pixi-tasks/test-cpp.sh", depends-on = ["build-cpp"] } # ── UnitTests job: pure Rust, no subprocess spawning ── -test-common = { cmd = "cargo test -p crowdb-common --all-targets" } -test-harness = { cmd = "cargo test -p crowdb-test-harness --all-targets" } -test-protocol = { cmd = "cargo test -p crowdb-protocol --all-targets" } -test-kv-core = { cmd = "cargo test -p crowdb-kv --all-targets" } -test-kv-client = { cmd = "cargo test -p crowdb-kv-client --all-targets" } -test-chunkdb-client = { cmd = "cargo test -p crowdb-chunkdb-client --all-targets" } -test-chunk-kv = { cmd = "cargo test -p crowdb-chunk-kv --all-targets" } -test-chunk-stream = { cmd = "cargo test -p crowdb-chunk-stream --all-targets" } -test-chunk-kv-client = { cmd = "cargo test -p crowdb-chunk-kv-client --all-targets" } -test-chunk-kv-server = { cmd = "cargo test -p crowdb-chunk-kv-server --all-targets" } -test-unit = { cmd = "bash tools/pixi-tasks/test-unit.sh", depends-on = ["build-tests"] } +test-common = { cmd = "cargo test -p crowdb-common --tests" } +test-harness = { cmd = "cargo test -p crowdb-test-harness --tests" } +test-protocol = { cmd = "cargo test -p crowdb-protocol --tests" } +test-kv-core = { cmd = "cargo test -p crowdb-kv --tests" } +test-kv-client = { cmd = "cargo test -p crowdb-kv-client --tests" } +test-chunkdb-client = { cmd = "cargo test -p crowdb-chunkdb-client --tests" } +test-chunk-kv = { cmd = "cargo test -p crowdb-chunk-kv --tests" } +test-chunk-stream = { cmd = "cargo test -p crowdb-chunk-stream --tests" } +test-chunk-kv-client = { cmd = "cargo test -p crowdb-chunk-kv-client --tests" } +test-chunk-kv-server = { cmd = "cargo test -p crowdb-chunk-kv-server --tests" } +test-unit = { cmd = "bash tools/pixi-tasks/test-unit.sh" } # ── ServerTests job: spawns crowdb-kv-server / crowdb-diskdb / crowdb-diskio ── -test-kv-server = { cmd = "cargo test -p crowdb-kv-server --all-targets" } -test-diskdb = { cmd = "cargo test -p crowdb-diskdb --all-targets" } -test-diskdb-client = { cmd = "cargo build -p crowdb-kv-server -p crowdb-diskdb && cargo test -p crowdb-diskdb-client --all-targets" } -test-chunkdb = { cmd = "cargo test -p crowdb-chunkdb --all-targets" } -test-chunk-client = { cmd = "cargo test -p crowdb-chunk-client --all-targets" } -test-diskio-client = { cmd = "cargo test -p crowdb-diskio-client --all-targets" } -test-access-s3 = { cmd = "cargo test -p crowdb-access-s3 --all-targets" } -test-access-iceberg = { cmd = "cargo test -p crowdb-access-iceberg --all-targets" } -test-access-server = { cmd = "cargo test -p crowdb-access-server --all-targets" } -test-monitor = { cmd = "cargo test -p crowdb-monitor --all-targets" } -test-server = { cmd = "bash tools/pixi-tasks/test-server.sh", depends-on = ["build-tests"] } +test-kv-server = { cmd = "cargo test -p crowdb-kv-server --tests" } +test-diskdb = { cmd = "cargo test -p crowdb-diskdb --tests" } +test-diskdb-client = { cmd = "cargo build -p crowdb-kv-server -p crowdb-diskdb && cargo test -p crowdb-diskdb-client --tests" } +test-chunkdb = { cmd = "cargo test -p crowdb-chunkdb --tests" } +test-chunk-client = { cmd = "cargo test -p crowdb-chunk-client --tests" } +test-diskio-client = { cmd = "cargo test -p crowdb-diskio-client --tests" } +test-access-s3 = { cmd = "cargo test -p crowdb-access-s3 --tests" } +test-access-iceberg = { cmd = "cargo test -p crowdb-access-iceberg --tests" } +test-access-server = { cmd = "cargo test -p crowdb-access-server --tests" } +test-monitor = { cmd = "cargo test -p crowdb-monitor --tests" } +test-server = { cmd = "bash tools/pixi-tasks/test-server.sh" } # ── ConsoleTests job: spawns crowdb-kv-server via lifecycle::deploy_local ── # Build the debug binary explicitly so tests find it at target/debug/. -test-console-shared = { cmd = "cargo build -p crowdb-kv-server && cargo test -p crowdb-console-shared --all-targets" } -test-console-cli = { cmd = "cargo test -p crowdb-cli --all-targets" } -test-console-server = { cmd = "cargo build -p crowdb-kv-server && cargo test -p crowdb-web --all-targets" } -test-console = { cmd = "bash tools/pixi-tasks/test-console.sh", depends-on = ["build-tests"] } +test-console-shared = { cmd = "cargo build -p crowdb-kv-server && cargo test -p crowdb-console-shared --tests" } +test-console-cli = { cmd = "cargo test -p crowdb-cli --tests" } +test-console-server = { cmd = "cargo build -p crowdb-kv-server && cargo test -p crowdb-web --tests" } +test-console = { cmd = "bash tools/pixi-tasks/test-console.sh" } # ── UITests job: Playwright browser E2E + subprocess spawning ── test-console-ui = { cmd = "bash tools/pixi-tasks/test-console-ui.sh", depends-on = ["install-ui-deps"] } diff --git a/tools/pixi-tasks/test-java-iceberg-e2e.sh b/tools/pixi-tasks/test-java-iceberg-e2e.sh index 9f97f9c5c..2ade415da 100644 --- a/tools/pixi-tasks/test-java-iceberg-e2e.sh +++ b/tools/pixi-tasks/test-java-iceberg-e2e.sh @@ -5,6 +5,8 @@ set -euo pipefail cd "${PIXI_PROJECT_ROOT:?}" source tools/pixi-tasks/prepare-iceberg.sh +pixi run -e iceberg-e2e -- mvn --batch-mode --no-transfer-progress \ + -f app/crowdb-access-server/tests/common/iceberg_java/pom.xml compile exec:help pixi run -e default -- cargo test --release -p crowdb-access-server --features iceberg-e2e \ --test iceberg_namespace_sdk_test official_catalog_continues_through_empty_namespace_pages -- --ignored --exact pixi run -e default -- cargo test --release -p crowdb-access-server --features iceberg-e2e \