Skip to content

Commit 110cc08

Browse files
ci(tests): lint and test the runner, tmachine and conformance suite
Run fmt, clippy and nextest for tests/tmachine and tests/runner, and fmt and clippy for the new `sandbox` suite crate, wherever tests/testkit already runs them: the mise tasks and Branch Checks. The suite's tests need a gateway, so they run through `mise run e2e:testkit` against a local Docker gateway and, on CI, through the test runner rather than the unit-test job. The lockfile task and the Cargo lockfiles job also run the alignment check, and its own tests run with `mise run test`. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent 90cbdec commit 110cc08

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

‎.github/workflows/branch-checks.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ jobs:
222222
cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all -- --check
223223
cargo fmt --manifest-path examples/isolation-backend-v8/Cargo.toml --all -- --check
224224
cargo fmt --manifest-path tests/testkit/Cargo.toml --all -- --check
225+
cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check
226+
cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check
227+
cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p sandbox -- --check
225228
226229
cargo-lockfiles:
227230
name: Cargo lockfiles
@@ -239,7 +242,9 @@ jobs:
239242

240243
- name: Verify Cargo lockfiles
241244
shell: nix develop -c bash -euo pipefail {0}
242-
run: tasks/scripts/check-cargo-lockfiles.sh
245+
run: |
246+
tasks/scripts/check-cargo-lockfiles.sh
247+
uv run tasks/scripts/check_cargo_lockfile_alignment.py
243248
244249
rust-lint:
245250
name: Rust lint (${{ matrix.system }})
@@ -279,6 +284,9 @@ jobs:
279284
cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings
280285
cargo clippy --locked --manifest-path examples/isolation-backend-v8/Cargo.toml --all-targets -- -D warnings
281286
cargo clippy --locked --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings
287+
cargo clippy --locked --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings
288+
cargo clippy --locked --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings
289+
cargo clippy --locked --manifest-path tests/suites/conformance/Cargo.toml -p sandbox --all-targets -- -D warnings
282290
283291
rust-test:
284292
name: Rust test (${{ matrix.system }})
@@ -328,6 +336,8 @@ jobs:
328336
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support
329337
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml
330338
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml
339+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/tmachine/Cargo.toml
340+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/runner/Cargo.toml
331341
332342
rust-postgres-test:
333343
name: Rust PostgreSQL tests

‎tasks/rust.toml‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts
1818
hide = true
1919

2020
["rust:lockfiles:check"]
21-
description = "Verify all tracked Cargo lockfiles are current"
22-
run = "tasks/scripts/check-cargo-lockfiles.sh"
21+
description = "Verify all tracked Cargo lockfiles are current and aligned with the root"
22+
run = [
23+
"tasks/scripts/check-cargo-lockfiles.sh",
24+
"uv run tasks/scripts/check_cargo_lockfile_alignment.py",
25+
]
2326
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/check-cargo-lockfiles.ps1"
2427
hide = true
2528

@@ -34,6 +37,9 @@ run = [
3437
"cargo clippy --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings",
3538
"cargo clippy --manifest-path examples/isolation-backend-v8/Cargo.toml --all-targets -- -D warnings",
3639
"cargo clippy --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings",
40+
"cargo clippy --manifest-path tests/tmachine/Cargo.toml --all-targets -- -D warnings",
41+
"cargo clippy --manifest-path tests/runner/Cargo.toml --all-targets -- -D warnings",
42+
"cargo clippy --manifest-path tests/suites/conformance/Cargo.toml -p sandbox --all-targets -- -D warnings",
3743
]
3844
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 lint native"
3945
hide = true
@@ -47,6 +53,9 @@ run = [
4753
"cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all",
4854
"cargo fmt --manifest-path examples/isolation-backend-v8/Cargo.toml --all",
4955
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all",
56+
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all",
57+
"cargo fmt --manifest-path tests/runner/Cargo.toml --all",
58+
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p sandbox",
5059
]
5160
hide = true
5261

@@ -59,6 +68,9 @@ run = [
5968
"cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all -- --check",
6069
"cargo fmt --manifest-path examples/isolation-backend-v8/Cargo.toml --all -- --check",
6170
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all -- --check",
71+
"cargo fmt --manifest-path tests/tmachine/Cargo.toml --all -- --check",
72+
"cargo fmt --manifest-path tests/runner/Cargo.toml --all -- --check",
73+
"cargo fmt --manifest-path tests/suites/conformance/Cargo.toml -p sandbox -- --check",
6274
]
6375
hide = true
6476

‎tasks/test.toml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ depends = [
2323
"test:docs-website",
2424
"test:docs-nav",
2525
"test:maintainer-approval",
26+
"test:cargo-lockfile-alignment",
2627
]
2728

29+
["test:cargo-lockfile-alignment"]
30+
description = "Test the Cargo lockfile alignment check"
31+
run = "uv run --no-project --with pytest pytest tasks/scripts/check_cargo_lockfile_alignment_test.py"
32+
2833
["test:docs-website"]
2934
description = "Test the docs-website sync script"
3035
# --no-project skips installing the OpenShell package; --with supplies the test
@@ -120,6 +125,8 @@ run = [
120125
"cargo test -p openshell-server --features test-support",
121126
"cargo nextest run --config-file .config/nextest.toml --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml",
122127
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/testkit/Cargo.toml",
128+
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/tmachine/Cargo.toml",
129+
"cargo nextest run --config-file .config/nextest.toml --manifest-path tests/runner/Cargo.toml",
123130
]
124131
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 test-precommit native"
125132
hide = true
@@ -160,6 +167,10 @@ run = "OPENSHELL_TEST_CONTAINER_ENGINE=docker e2e/with-docker-gateway.sh cargo t
160167
description = "Run the shared OCI image feature suite against a Podman-backed gateway"
161168
run = "OPENSHELL_TEST_CONTAINER_ENGINE=podman e2e/with-podman-gateway.sh cargo test --locked --manifest-path tests/suites/features/Cargo.toml -p openshell-test-feature-oci-image -- --test-threads 1 --nocapture"
162169

170+
["e2e:testkit"]
171+
description = "Run the testkit suites in tests/suites/conformance against a Docker-backed gateway"
172+
run = "e2e/with-docker-gateway.sh cargo nextest run --locked --manifest-path tests/suites/conformance/Cargo.toml --workspace --exclude openshell-test-conformance-cli --test-threads 1 --no-fail-fast"
173+
163174
["e2e:rust:push"]
164175
description = "Run CLI conformance and policy e2e tests against a Docker gateway that pushes configuration"
165176
depends = ["e2e:conformance:build"]

0 commit comments

Comments
 (0)