From bc4c2abcd6e34c6f53834798f7296bb640541219 Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Wed, 2 Sep 2026 14:30:43 -0700 Subject: [PATCH 1/7] Initial split of `cargo ci test` --- .github/workflows/ci.yml | 95 ++++++++++++++++++++++++++++-- tools/ci/commands/test/src/main.rs | 74 +++++++++++++++++++---- 2 files changed, 153 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4900d307139..fd94e54a29f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -835,11 +835,12 @@ jobs: - name: Skip duplicate merge queue SDK test run: echo "Merge queue commit has the same tree as the PR head; SDK tests already ran for the PR." - test: + rust_tests: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} - name: Test Suite + name: Rust Test Suite runs-on: spacetimedb-linux + timeout-minutes: 10 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target @@ -917,19 +918,103 @@ jobs: ./emsdk activate 4.0.21 # Source emsdk environment to make emcc (Emscripten compiler) available in PATH. - - name: Run tests + - name: Run Rust tests run: | source ~/emsdk/emsdk_env.sh - cargo ci test + cargo ci test rust + + # Keep this beside the warm Rust build rather than recompiling + # spacetimedb-codegen in the C# test job. + - name: Check generated C# module definition + run: cargo ci test csharp-codegen - name: Upload timing reports if: always() uses: actions/upload-artifact@v4 with: - name: cargo-timings-test + name: cargo-timings-rust-tests path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/ retention-days: 14 + csharp_bindings_tests: + needs: [merge_queue_noop, lints] + if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} + name: C# Bindings Tests + runs-on: spacetimedb-linux + timeout-minutes: 10 + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + + - uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + + - name: Run C# bindings tests + run: cargo ci test csharp + + cpp_compile_tests: + needs: [merge_queue_noop, lints] + if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} + name: C++ Compile Tests (${{ matrix.suite }}) + runs-on: spacetimedb-linux + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + suite: [http-handlers, indexes] + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + + - name: Install cmake and emscripten + run: | + sudo apt-get update + sudo apt-get install -y cmake + git clone https://github.com/emscripten-core/emsdk.git ~/emsdk + cd ~/emsdk + ./emsdk install 4.0.21 + ./emsdk activate 4.0.21 + + - name: Run C++ compile tests + run: | + source ~/emsdk/emsdk_env.sh + cargo ci test cpp --suite "${{ matrix.suite }}" + + test: + needs: [merge_queue_noop, rust_tests, csharp_bindings_tests, cpp_compile_tests] + if: ${{ always() }} + name: Test Suite + runs-on: spacetimedb-linux + timeout-minutes: 5 + steps: + - name: Check component results + if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} + env: + RUST_RESULT: ${{ needs.rust_tests.result }} + CSHARP_RESULT: ${{ needs.csharp_bindings_tests.result }} + CPP_RESULT: ${{ needs.cpp_compile_tests.result }} + run: | + test "${RUST_RESULT}" = success + test "${CSHARP_RESULT}" = success + test "${CPP_RESULT}" = success + + - name: Reuse merge queue result + if: ${{ needs.merge_queue_noop.outputs.skip == 'true' }} + run: echo "Test Suite already ran for the equivalent PR head." + index_scan_bench: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} diff --git a/tools/ci/commands/test/src/main.rs b/tools/ci/commands/test/src/main.rs index 26242e4f480..95f641ddf9d 100644 --- a/tools/ci/commands/test/src/main.rs +++ b/tools/ci/commands/test/src/main.rs @@ -1,7 +1,7 @@ #![allow(clippy::disallowed_macros)] use anyhow::Result; use ci_common::pnpm; -use clap::Parser; +use clap::{Parser, Subcommand, ValueEnum}; use duct::cmd; /// Runs tests @@ -10,11 +10,58 @@ use duct::cmd; /// This does not include Unreal tests. /// This expects to run in a clean git state. #[derive(Parser)] -struct Cli {} +struct Cli { + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand)] +enum TestCommand { + /// Run the Rust workspace and feature tests. + Rust, + /// Regenerate the C# module definition and check that it is committed. + CsharpCodegen, + /// Run the C# bindings tests. + Csharp, + /// Run a C++ compile-test suite. + Cpp { + #[arg(long, value_enum)] + suite: CppSuite, + }, +} + +#[derive(Clone, Copy, ValueEnum)] +enum CppSuite { + HttpHandlers, + Indexes, +} + +impl CppSuite { + fn as_str(self) -> &'static str { + match self { + Self::HttpHandlers => "http-handlers", + Self::Indexes => "indexes", + } + } +} fn main() -> Result<()> { - Cli::parse(); + match Cli::parse().command { + Some(TestCommand::Rust) => rust_tests(), + Some(TestCommand::CsharpCodegen) => csharp_codegen(), + Some(TestCommand::Csharp) => csharp_tests(), + Some(TestCommand::Cpp { suite }) => cpp_tests(suite), + None => { + rust_tests()?; + csharp_codegen()?; + csharp_tests()?; + cpp_tests(CppSuite::HttpHandlers)?; + cpp_tests(CppSuite::Indexes) + } + } +} +fn rust_tests() -> Result<()> { pnpm(["build"]).dir("crates/bindings-typescript").run()?; // TODO: This doesn't work on at least user Linux machines, because something here apparently uses `sudo`? @@ -69,6 +116,10 @@ fn main() -> Result<()> { ) .run()?; cmd!("bash", "tools/check-diff.sh").run()?; + Ok(()) +} + +fn csharp_codegen() -> Result<()> { cmd!( "cargo", "run", @@ -79,21 +130,22 @@ fn main() -> Result<()> { ) .run()?; cmd!("bash", "tools/check-diff.sh", "crates/bindings-csharp").run()?; + Ok(()) +} + +fn csharp_tests() -> Result<()> { cmd!("dotnet", "test", "-warnaserror") .dir("crates/bindings-csharp") .run()?; + Ok(()) +} + +fn cpp_tests(suite: CppSuite) -> Result<()> { cmd!( "bash", "crates/bindings-cpp/tests/compile/run-compile-tests.sh", "--suite", - "http-handlers", - ) - .run()?; - cmd!( - "bash", - "crates/bindings-cpp/tests/compile/run-compile-tests.sh", - "--suite", - "indexes", + suite.as_str(), ) .run()?; From 79f934e2bf5844f64cff47621f51bf0de79022ec Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Thu, 3 Sep 2026 09:27:03 -0700 Subject: [PATCH 2/7] Bump timeout to see full run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd94e54a29f..b294f673cd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -840,7 +840,7 @@ jobs: if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} name: Rust Test Suite runs-on: spacetimedb-linux - timeout-minutes: 10 + timeout-minutes: 15 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target From 0532f6910094a31b0f57d4689654122169016f71 Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Thu, 3 Sep 2026 14:25:24 -0700 Subject: [PATCH 3/7] Split out C# codegen --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b4585983e5..68114e9c417 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1060,8 +1060,39 @@ jobs: source ~/emsdk/emsdk_env.sh cargo ci test rust - # Keep this beside the warm Rust build rather than recompiling - # spacetimedb-codegen in the C# test job. + - name: Upload timing reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: cargo-timings-rust-tests + path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/ + retention-days: 14 + + csharp_codegen_check: + needs: [merge_queue_noop, lints] + if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} + name: C# Codegen Check + runs-on: spacetimedb-linux + timeout-minutes: 10 + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + - *set-native-cache-keys + - *restore-jemalloc + - *configure-cached-jemalloc + - *restore-zstd + - *configure-cached-zstd + - *restore-rusty-v8-debug + - *restore-rusty-v8 + - *restore-openssl + - *configure-cached-openssl + - name: Check generated C# module definition run: cargo ci test csharp-codegen @@ -1069,7 +1100,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: cargo-timings-rust-tests + name: cargo-timings-csharp-codegen path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/ retention-days: 14 @@ -1131,7 +1162,14 @@ jobs: cargo ci test cpp --suite "${{ matrix.suite }}" test: - needs: [merge_queue_noop, rust_tests, csharp_bindings_tests, cpp_compile_tests] + needs: + [ + merge_queue_noop, + rust_tests, + csharp_codegen_check, + csharp_bindings_tests, + cpp_compile_tests, + ] if: ${{ always() }} name: Test Suite runs-on: spacetimedb-linux @@ -1141,10 +1179,12 @@ jobs: if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} env: RUST_RESULT: ${{ needs.rust_tests.result }} + CSHARP_CODEGEN_RESULT: ${{ needs.csharp_codegen_check.result }} CSHARP_RESULT: ${{ needs.csharp_bindings_tests.result }} CPP_RESULT: ${{ needs.cpp_compile_tests.result }} run: | test "${RUST_RESULT}" = success + test "${CSHARP_CODEGEN_RESULT}" = success test "${CSHARP_RESULT}" = success test "${CPP_RESULT}" = success From 447058b9b21ae8ecec3576ed2e9991f043de73c9 Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Thu, 3 Sep 2026 15:15:12 -0700 Subject: [PATCH 4/7] Split up Rust Tests --- .github/workflows/ci.yml | 227 +++++++++++++++++++++++++++++++++------ 1 file changed, 193 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68114e9c417..045aa8e4d99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -972,37 +972,24 @@ jobs: - name: Skip duplicate merge queue SDK test run: echo "Merge queue commit has the same tree as the PR head; SDK tests already ran for the PR." - rust_tests: + rust_test_build: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} - name: Rust Test Suite + name: Test Suite - Rust Build runs-on: spacetimedb-linux timeout-minutes: 15 - env: CARGO_TARGET_DIR: ${{ github.workspace }}/target RUST_BACKTRACE: full + RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst + RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst + RUST_DURABILITY_TEST_ARCHIVE: rust-durability-tests-nextest.tar.zst steps: - - name: Find Git ref - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_NUMBER="${{ github.event.inputs.pr_number || null }}" - if test -n "${PR_NUMBER}"; then - GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" - else - GIT_REF="${{ github.ref }}" - fi - echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" - - - name: Checkout sources - uses: actions/checkout@v4 - with: - ref: ${{ env.GIT_REF }} + - *find-git-ref + - *checkout-sources - uses: dsherret/rust-toolchain-file@v1 - - name: Set default rust toolchain - run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + - *set-default-rust-toolchain - *set-native-cache-keys - &restore-jemalloc name: Restore jemalloc @@ -1031,6 +1018,122 @@ jobs: - *restore-openssl - *configure-cached-openssl + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Build Rust test archives + run: | + cargo nextest archive --timings --workspace \ + --exclude spacetimedb-smoketests \ + --exclude spacetimedb-sdk \ + --exclude spacetimedb \ + --archive-file "${RUST_TEST_ARCHIVE}" + cargo nextest archive --timings -p spacetimedb --features unstable \ + --archive-file "${RUST_BINDINGS_TEST_ARCHIVE}" + cargo nextest archive --timings -p spacetimedb-durability --features fallocate \ + --archive-file "${RUST_DURABILITY_TEST_ARCHIVE}" + + # Nextest does not run doctests, so run them while the Cargo build is warm. + - name: Run Rust doctests + run: | + cargo test --workspace --doc \ + --exclude spacetimedb-smoketests \ + --exclude spacetimedb-sdk \ + --exclude spacetimedb \ + -- --test-threads=2 --skip unreal + cargo test -p spacetimedb --features unstable --doc -- --test-threads=2 + cargo test -p spacetimedb-durability --features fallocate --doc -- --test-threads=1 + bash tools/check-diff.sh + + - name: Upload Cargo timing reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: cargo-timings-rust-test-build + path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/ + if-no-files-found: warn + overwrite: true + retention-days: 14 + + - name: Upload Rust workspace test archive + uses: actions/upload-artifact@v4 + with: + name: rust-tests-linux + path: ${{ env.RUST_TEST_ARCHIVE }} + compression-level: 0 + if-no-files-found: error + overwrite: true + retention-days: 14 + + - name: Upload Rust feature test archives + uses: actions/upload-artifact@v4 + with: + name: rust-feature-tests-linux + path: | + ${{ env.RUST_BINDINGS_TEST_ARCHIVE }} + ${{ env.RUST_DURABILITY_TEST_ARCHIVE }} + compression-level: 0 + if-no-files-found: error + overwrite: true + retention-days: 14 + + rust_tests: + needs: [rust_test_build] + name: Test Suite - Rust (${{ matrix.partition }}/4) + runs-on: spacetimedb-linux + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + partition: [1, 2, 3, 4] + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst + RUST_TEST_PARTITIONS: 4 + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Download Rust test archive + uses: actions/download-artifact@v4 + with: + name: rust-tests-linux + + - name: Run Rust test partition + run: | + cargo nextest run \ + --archive-file "${RUST_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + --partition hash:${{ matrix.partition }}/${RUST_TEST_PARTITIONS} \ + -E 'not binary(=spacetimedb_bench) & not binary(=codegen) & not binary(=ensure_same_schema) & not binary(=standalone_integration_test) & not test(/unreal/)' \ + --no-fail-fast \ + --no-tests pass \ + -j 2 + bash tools/check-diff.sh + + rust_serial_tests: + needs: [rust_test_build] + name: Test Suite - Rust Serial Integration + runs-on: spacetimedb-linux + timeout-minutes: 10 + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + - uses: actions/setup-dotnet@v3 with: global-json-file: global.json @@ -1044,7 +1147,6 @@ jobs: with: run_install: true - # Install cmake and emscripten for C++ module compilation tests. - name: Install cmake and emscripten run: | sudo apt-get update @@ -1054,24 +1156,72 @@ jobs: ./emsdk install 4.0.21 ./emsdk activate 4.0.21 - # Source emsdk environment to make emcc (Emscripten compiler) available in PATH. - - name: Run Rust tests + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Download Rust test archive + uses: actions/download-artifact@v4 + with: + name: rust-tests-linux + + - name: Run serial integration tests run: | source ~/emsdk/emsdk_env.sh - cargo ci test rust + pnpm --dir crates/bindings-typescript build + cargo nextest run \ + --archive-file "${RUST_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + -E 'binary(=spacetimedb_bench) | binary(=codegen) | binary(=ensure_same_schema) | binary(=standalone_integration_test)' \ + --no-fail-fast \ + --no-tests fail \ + -j 1 + bash tools/check-diff.sh - - name: Upload timing reports - if: always() - uses: actions/upload-artifact@v4 + rust_feature_tests: + needs: [rust_test_build] + name: Test Suite - Rust Features + runs-on: spacetimedb-linux + timeout-minutes: 10 + env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target + RUST_BACKTRACE: full + RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst + RUST_DURABILITY_TEST_ARCHIVE: rust-durability-tests-nextest.tar.zst + steps: + - *find-git-ref + - *checkout-sources + + - uses: dsherret/rust-toolchain-file@v1 + - *set-default-rust-toolchain + + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Download Rust test archives + uses: actions/download-artifact@v4 with: - name: cargo-timings-rust-tests - path: ${{ env.CARGO_TARGET_DIR }}/cargo-timings/ - retention-days: 14 + name: rust-feature-tests-linux + + - name: Run feature tests + run: | + cargo nextest run \ + --archive-file "${RUST_BINDINGS_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + --no-fail-fast \ + --no-tests fail \ + -j 2 + cargo nextest run \ + --archive-file "${RUST_DURABILITY_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + --no-fail-fast \ + --no-tests fail \ + -j 1 + bash tools/check-diff.sh csharp_codegen_check: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} - name: C# Codegen Check + name: Test Suite - C# Codegen runs-on: spacetimedb-linux timeout-minutes: 10 env: @@ -1107,7 +1257,7 @@ jobs: csharp_bindings_tests: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} - name: C# Bindings Tests + name: Test Suite - C# Bindings runs-on: spacetimedb-linux timeout-minutes: 10 env: @@ -1130,7 +1280,7 @@ jobs: cpp_compile_tests: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} - name: C++ Compile Tests (${{ matrix.suite }}) + name: Test Suite - C++ Compile (${{ matrix.suite }}) runs-on: spacetimedb-linux timeout-minutes: 10 strategy: @@ -1165,7 +1315,10 @@ jobs: needs: [ merge_queue_noop, + rust_test_build, rust_tests, + rust_serial_tests, + rust_feature_tests, csharp_codegen_check, csharp_bindings_tests, cpp_compile_tests, @@ -1179,11 +1332,17 @@ jobs: if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} env: RUST_RESULT: ${{ needs.rust_tests.result }} + RUST_BUILD_RESULT: ${{ needs.rust_test_build.result }} + RUST_SERIAL_RESULT: ${{ needs.rust_serial_tests.result }} + RUST_FEATURE_RESULT: ${{ needs.rust_feature_tests.result }} CSHARP_CODEGEN_RESULT: ${{ needs.csharp_codegen_check.result }} CSHARP_RESULT: ${{ needs.csharp_bindings_tests.result }} CPP_RESULT: ${{ needs.cpp_compile_tests.result }} run: | + test "${RUST_BUILD_RESULT}" = success test "${RUST_RESULT}" = success + test "${RUST_SERIAL_RESULT}" = success + test "${RUST_FEATURE_RESULT}" = success test "${CSHARP_CODEGEN_RESULT}" = success test "${CSHARP_RESULT}" = success test "${CPP_RESULT}" = success From 0236c698f90e04695b0fc2df6b6bf1cf19e7fe73 Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Thu, 3 Sep 2026 15:43:05 -0700 Subject: [PATCH 5/7] Debug reduction for archive --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 045aa8e4d99..aa1ebeb75f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -980,6 +980,8 @@ jobs: timeout-minutes: 15 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target + # Full test debuginfo makes the nextest archive several GiB. + CARGO_PROFILE_TEST_DEBUG: 0 RUST_BACKTRACE: full RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst From 41e62934e01ac06b368d48f750b369bee313079d Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Thu, 3 Sep 2026 16:04:04 -0700 Subject: [PATCH 6/7] Fix for features --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa1ebeb75f2..cac77afd6b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -980,8 +980,9 @@ jobs: timeout-minutes: 15 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target - # Full test debuginfo makes the nextest archive several GiB. - CARGO_PROFILE_TEST_DEBUG: 0 + # Full test debuginfo makes the nextest archive several GiB. Level 1 keeps + # line tables for useful CI backtraces without embedding full DWARF. + CARGO_PROFILE_TEST_DEBUG: 1 RUST_BACKTRACE: full RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst @@ -1047,6 +1048,14 @@ jobs: cargo test -p spacetimedb-durability --features fallocate --doc -- --test-threads=1 bash tools/check-diff.sh + # Trybuild discovers enabled features from Cargo fingerprint metadata, + # which nextest archives do not contain. Keep this target on the build + # runner, where that metadata is still available. + - name: Run Rust feature UI tests + run: | + cargo test -p spacetimedb --features unstable --test ui -- --test-threads=2 + bash tools/check-diff.sh + - name: Upload Cargo timing reports if: always() uses: actions/upload-artifact@v4 @@ -1209,6 +1218,7 @@ jobs: cargo nextest run \ --archive-file "${RUST_BINDINGS_TEST_ARCHIVE}" \ --workspace-remap "${GITHUB_WORKSPACE}" \ + -E 'not binary(=ui)' \ --no-fail-fast \ --no-tests fail \ -j 2 From cc3aa1c0079130d5f7785ca6b00471cb977fc3c9 Mon Sep 17 00:00:00 2001 From: JasonAtClockwork Date: Fri, 4 Sep 2026 07:55:55 -0700 Subject: [PATCH 7/7] Remove tiny split --- .github/workflows/ci.yml | 77 +++++++++++++++------------------------- 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cac77afd6b9..2751f55b156 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1131,13 +1131,15 @@ jobs: rust_serial_tests: needs: [rust_test_build] - name: Test Suite - Rust Serial Integration + name: Test Suite - Rust Serial & Features runs-on: spacetimedb-linux timeout-minutes: 10 env: CARGO_TARGET_DIR: ${{ github.workspace }}/target RUST_BACKTRACE: full RUST_TEST_ARCHIVE: rust-tests-nextest.tar.zst + RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst + RUST_DURABILITY_TEST_ARCHIVE: rust-durability-tests-nextest.tar.zst steps: - *find-git-ref - *checkout-sources @@ -1145,6 +1147,31 @@ jobs: - uses: dsherret/rust-toolchain-file@v1 - *set-default-rust-toolchain + - name: Install cargo-nextest + uses: taiki-e/install-action@nextest + + - name: Download Rust feature test archives + uses: actions/download-artifact@v4 + with: + name: rust-feature-tests-linux + + - name: Run feature tests + run: | + cargo nextest run \ + --archive-file "${RUST_BINDINGS_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + -E 'not binary(=ui)' \ + --no-fail-fast \ + --no-tests fail \ + -j 2 + cargo nextest run \ + --archive-file "${RUST_DURABILITY_TEST_ARCHIVE}" \ + --workspace-remap "${GITHUB_WORKSPACE}" \ + --no-fail-fast \ + --no-tests fail \ + -j 1 + bash tools/check-diff.sh + - uses: actions/setup-dotnet@v3 with: global-json-file: global.json @@ -1167,9 +1194,6 @@ jobs: ./emsdk install 4.0.21 ./emsdk activate 4.0.21 - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - name: Download Rust test archive uses: actions/download-artifact@v4 with: @@ -1188,48 +1212,6 @@ jobs: -j 1 bash tools/check-diff.sh - rust_feature_tests: - needs: [rust_test_build] - name: Test Suite - Rust Features - runs-on: spacetimedb-linux - timeout-minutes: 10 - env: - CARGO_TARGET_DIR: ${{ github.workspace }}/target - RUST_BACKTRACE: full - RUST_BINDINGS_TEST_ARCHIVE: rust-bindings-tests-nextest.tar.zst - RUST_DURABILITY_TEST_ARCHIVE: rust-durability-tests-nextest.tar.zst - steps: - - *find-git-ref - - *checkout-sources - - - uses: dsherret/rust-toolchain-file@v1 - - *set-default-rust-toolchain - - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - - name: Download Rust test archives - uses: actions/download-artifact@v4 - with: - name: rust-feature-tests-linux - - - name: Run feature tests - run: | - cargo nextest run \ - --archive-file "${RUST_BINDINGS_TEST_ARCHIVE}" \ - --workspace-remap "${GITHUB_WORKSPACE}" \ - -E 'not binary(=ui)' \ - --no-fail-fast \ - --no-tests fail \ - -j 2 - cargo nextest run \ - --archive-file "${RUST_DURABILITY_TEST_ARCHIVE}" \ - --workspace-remap "${GITHUB_WORKSPACE}" \ - --no-fail-fast \ - --no-tests fail \ - -j 1 - bash tools/check-diff.sh - csharp_codegen_check: needs: [merge_queue_noop, lints] if: ${{ needs.merge_queue_noop.outputs.skip != 'true' }} @@ -1330,7 +1312,6 @@ jobs: rust_test_build, rust_tests, rust_serial_tests, - rust_feature_tests, csharp_codegen_check, csharp_bindings_tests, cpp_compile_tests, @@ -1346,7 +1327,6 @@ jobs: RUST_RESULT: ${{ needs.rust_tests.result }} RUST_BUILD_RESULT: ${{ needs.rust_test_build.result }} RUST_SERIAL_RESULT: ${{ needs.rust_serial_tests.result }} - RUST_FEATURE_RESULT: ${{ needs.rust_feature_tests.result }} CSHARP_CODEGEN_RESULT: ${{ needs.csharp_codegen_check.result }} CSHARP_RESULT: ${{ needs.csharp_bindings_tests.result }} CPP_RESULT: ${{ needs.cpp_compile_tests.result }} @@ -1354,7 +1334,6 @@ jobs: test "${RUST_BUILD_RESULT}" = success test "${RUST_RESULT}" = success test "${RUST_SERIAL_RESULT}" = success - test "${RUST_FEATURE_RESULT}" = success test "${CSHARP_CODEGEN_RESULT}" = success test "${CSHARP_RESULT}" = success test "${CPP_RESULT}" = success