Skip to content

Commit 0e69f45

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 c3b0417 commit 0e69f45

3 files changed

Lines changed: 36 additions & 8 deletions

File tree

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +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/suites/sandbox/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
226228
227229
cargo-lockfiles:
228230
name: Cargo lockfiles
@@ -240,7 +242,9 @@ jobs:
240242

241243
- name: Verify Cargo lockfiles
242244
shell: nix develop -c bash -euo pipefail {0}
243-
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
244248
245249
rust-lint:
246250
name: Rust lint (${{ matrix.system }})
@@ -280,7 +284,9 @@ jobs:
280284
cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings
281285
cargo clippy --locked --manifest-path examples/isolation-backend-v8/Cargo.toml --all-targets -- -D warnings
282286
cargo clippy --locked --manifest-path tests/testkit/Cargo.toml --all-targets -- -D warnings
283-
cargo clippy --locked --manifest-path tests/suites/sandbox/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
284290
285291
rust-test:
286292
name: Rust test (${{ matrix.system }})
@@ -330,6 +336,8 @@ jobs:
330336
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support
331337
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml
332338
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
333341
334342
rust-postgres-test:
335343
name: Rust PostgreSQL tests

‎tasks/rust.toml‎

Lines changed: 14 additions & 5 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,7 +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",
37-
"cargo clippy --manifest-path tests/suites/sandbox/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",
3843
]
3944
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 lint native"
4045
hide = true
@@ -48,7 +53,9 @@ run = [
4853
"cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all",
4954
"cargo fmt --manifest-path examples/isolation-backend-v8/Cargo.toml --all",
5055
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all",
51-
"cargo fmt --manifest-path tests/suites/sandbox/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",
5259
]
5360
hide = true
5461

@@ -61,7 +68,9 @@ run = [
6168
"cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all -- --check",
6269
"cargo fmt --manifest-path examples/isolation-backend-v8/Cargo.toml --all -- --check",
6370
"cargo fmt --manifest-path tests/testkit/Cargo.toml --all -- --check",
64-
"cargo fmt --manifest-path tests/suites/sandbox/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",
6574
]
6675
hide = true
6776

‎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
@@ -164,6 +171,10 @@ run = "OPENSHELL_TEST_CONTAINER_ENGINE=docker e2e/with-docker-gateway.sh cargo t
164171
description = "Run the shared OCI image feature suite against a Podman-backed gateway"
165172
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"
166173

174+
["e2e:testkit"]
175+
description = "Run the testkit suites in tests/suites/conformance against a Docker-backed gateway"
176+
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"
177+
167178
["e2e:rust:push"]
168179
description = "Run CLI conformance and policy e2e tests against a Docker gateway that pushes configuration"
169180
depends = ["e2e:conformance:build"]

0 commit comments

Comments
 (0)