From 09691f8c43dff7af8b2e6463e9c20d5babb9f8d6 Mon Sep 17 00:00:00 2001 From: repo-worker-tmp-code-b Date: Tue, 10 Nov 2026 23:07:15 -0600 Subject: [PATCH] feat(id): run plaza-sdk + rust-counter tests in flake checks, rebuild-gate counter.wasm (#7904) --- .github/scripts/id-pr-checks.txt | 2 ++ .github/test-suite-registry.json | 28 ++++++++++++++++++++++++++++ pkgs/id/flake.nix | 32 ++++++++++++++++++++++++++++++++ pkgs/id/just-recipes.json | 23 ++++++++++++++++++++--- pkgs/id/justfile | 8 +++++++- 5 files changed, 89 insertions(+), 4 deletions(-) diff --git a/.github/scripts/id-pr-checks.txt b/.github/scripts/id-pr-checks.txt index 461f8a4823..171226e497 100644 --- a/.github/scripts/id-pr-checks.txt +++ b/.github/scripts/id-pr-checks.txt @@ -34,6 +34,7 @@ cargo-check prod-lines-check test-unit test-native-shell +test-rust-examples test-shard-0 test-shard-1 test-shard-2 @@ -42,6 +43,7 @@ test-web-unit test-web-typecheck roc-test roc-examples +rust-counter-wasm crash-gate-sampled crash-gate-sweep crash-gate-control diff --git a/.github/test-suite-registry.json b/.github/test-suite-registry.json index 090c537885..01da09c386 100644 --- a/.github/test-suite-registry.json +++ b/.github/test-suite-registry.json @@ -152,6 +152,34 @@ }, "status": "mapped" }, + { + "id": "id.examples.plaza-sdk", + "paths": ["pkgs/id/examples/rust-world/src/**"], + "invocation": "cargo test --manifest-path examples/rust-world/Cargo.toml (test-rust-examples flake check)", + "venue": { + "workflow": ".github/workflows/id-check.yml", + "job_step": "check_each / test-rust-examples", + "state": "active", + "dispatchable": true + }, + "status": "mapped", + "related_issues": [7904], + "notes": "plaza-sdk is a standalone crate outside the pkgs/id workspace (own [workspace] table), so workspace test venues never ran its 9 unit tests before #7904." + }, + { + "id": "id.examples.rust-counter", + "paths": ["pkgs/id/examples/rust-counter/src/**"], + "invocation": "cargo test --manifest-path examples/rust-counter/Cargo.toml (test-rust-examples flake check); counter.wasm rebuilt from source and sandbox-tested in the rust-counter-wasm flake check", + "venue": { + "workflow": ".github/workflows/id-check.yml", + "job_step": "check_each / test-rust-examples", + "state": "active", + "dispatchable": true + }, + "status": "mapped", + "related_issues": [7904], + "notes": "Standalone crate (path dependency on plaza-sdk); its checked-in counter.wasm is loaded by the sandbox conformance tests (src/sandbox.rs), and the rust-counter-wasm check rebuilds the module from source (roc-examples pattern) and runs those tests against the rebuild -- wasm bytes are not reproducible across rustc builds, so no byte gate." + }, { "id": "id.web.playwright", "paths": ["pkgs/id/e2e/tests/*.spec.ts"], diff --git a/pkgs/id/flake.nix b/pkgs/id/flake.nix index 852a7ad689..849d830dcc 100644 --- a/pkgs/id/flake.nix +++ b/pkgs/id/flake.nix @@ -159,6 +159,14 @@ ''; }; + # Same pinned toolchain plus the wasm32-unknown-unknown target + # (#7904): rust-toolchain.toml carries no targets, so the stock + # toolchain cannot rebuild examples/rust-counter/counter.wasm; + # the rebuild check below needs this override. + rustToolchainWasm = rustToolchain.override { + targets = [ "wasm32-unknown-unknown" ]; + }; + # Helper to create a check that runs a just command or direct test # command, with an optional pre-check step and check-specific tools. mkCheck = name: justCmd: mkCheckWith { inherit name justCmd; }; @@ -362,6 +370,30 @@ test = mkCheck "test" "test-sandbox"; test-unit = mkCheck "test-unit" "test-unit"; test-native-shell = mkCheck "test-native-shell" "test-native-shell"; + # Rust example guests (#7904): plaza-sdk (examples/rust-world) + # and rust-counter (examples/rust-counter) are standalone + # crates outside the pkgs/id workspace, so no workspace test + # check ever ran their unit tests (9 + 2). + test-rust-examples = mkCheck "test-rust-examples" "test-rust-examples"; + # Rebuild the Rust counter guest from source and run the + # sandbox tests against the rebuilt module (#7904) -- the + # roc-examples pattern. Wasm bytes are not reproducible + # across rustc builds or build paths (the producers/code + # sections differ between the rustup and rust-overlay + # builds of the same pinned 1.99.0), so a byte drift gate + # would be permanently red; what CI must prove is that the + # module built from current source passes the conformance + # tests that load it (src/sandbox.rs include_bytes!). + rust-counter-wasm = mkCheckWith { + name = "rust-counter-wasm"; + beforeCheck = '' + export PATH="${rustToolchainWasm}/bin:$PATH" + bash examples/rust-counter/build.sh + ''; + checkCommand = '' + cargo test --no-default-features --features sandbox,world --lib sandbox + ''; + }; test-int = mkCheck "test-int" "test-int-sandbox"; # PR-gate shards of the integration suite (#869): the four # shards together run every target test-sandbox runs, in diff --git a/pkgs/id/just-recipes.json b/pkgs/id/just-recipes.json index c1a46a2160..fb4133c56f 100644 --- a/pkgs/id/just-recipes.json +++ b/pkgs/id/just-recipes.json @@ -827,7 +827,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/user/git/fleet/6592/root.just", + "source": "/home/user/git/fleet/14257-7904-rust-sdk-venue/root.just", "unexports": [], "warnings": [] } @@ -1468,6 +1468,7 @@ { "arguments": [], "recipe": "web-lint", "star": null }, { "arguments": [], "recipe": "test-sandbox", "star": null }, { "arguments": [], "recipe": "test-native-shell", "star": null }, + { "arguments": [], "recipe": "test-rust-examples", "star": null }, { "arguments": [], "recipe": "test-web-unit", "star": null }, { "arguments": [], "recipe": "test-web-typecheck", "star": null }, { "arguments": [], "recipe": "roc-test", "star": null }, @@ -1478,7 +1479,7 @@ "doc": "CI-safe checks (read-only, no modifications) [bun]", "name": "ci", "parameters": [], - "priors": 14, + "priors": 15, "private": false, "quiet": false, "namepath": "ci", @@ -2740,6 +2741,22 @@ "namepath": "test-rust", "shebang": false }, + "test-rust-examples": { + "attributes": [{ "group": "test" }], + "body": [ + ["cargo test --manifest-path examples/rust-world/Cargo.toml"], + ["cargo test --manifest-path examples/rust-counter/Cargo.toml"] + ], + "dependencies": [], + "doc": "Run the Rust example-guest unit tests (#7904): plaza-sdk (examples/rust-world, 9 tests) and rust-counter (examples/rust-counter, 2 tests) are standalone crates outside the pkgs/id workspace, so the workspace test recipes never run them.", + "name": "test-rust-examples", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "test-rust-examples", + "shebang": false + }, "test-sandbox": { "attributes": [{ "group": "test" }], "body": [["cargo nextest run --all-features -E 'not test(serve_tests)'"]], @@ -3339,7 +3356,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/user/git/fleet/14371-6378-nextest/pkgs/id/justfile", + "source": "/home/user/git/fleet/14257-7904-rust-sdk-venue/pkgs/id/justfile", "unexports": [], "warnings": [] } diff --git a/pkgs/id/justfile b/pkgs/id/justfile index 0565b19bb5..d5e9967aab 100644 --- a/pkgs/id/justfile +++ b/pkgs/id/justfile @@ -36,7 +36,7 @@ alias check-all := check # CI-safe checks (read-only, no modifications) [bun] [group('check')] -ci: cargo-fmt-check web-fmt-check cargo-check clippy-lint clippy-native-shell web-lint test-sandbox test-native-shell test-web-unit test-web-typecheck roc-test doc build release +ci: cargo-fmt-check web-fmt-check cargo-check clippy-lint clippy-native-shell web-lint test-sandbox test-native-shell test-rust-examples test-web-unit test-web-typecheck roc-test doc build release @echo "✓ CI checks passed!" # Auto-fix formatting and lint issues @@ -299,6 +299,12 @@ alias test-lib := test-unit test-native-shell: cargo nextest run -p id-native-shell +# Run the Rust example-guest unit tests (#7904): plaza-sdk (examples/rust-world, 9 tests) and rust-counter (examples/rust-counter, 2 tests) are standalone crates outside the pkgs/id workspace, so the workspace test recipes never run them. +[group('test')] +test-rust-examples: + cargo test --manifest-path examples/rust-world/Cargo.toml + cargo test --manifest-path examples/rust-counter/Cargo.toml + # Run the F11.8 benchmark harness (issue #539): journal append+fsync, checkpoint compaction, guest replay, session fan-out bench *args: cargo bench --bench world_bench -- {{ args }}