Skip to content

Commit 846fa93

Browse files
committed
refactor(e2e): align suite layout with testing strategy
Move behavioral suites under e2e/suites and extract shared Rust tooling into e2e/support/rust. Organize conformance tests into one Cargo target per area with story modules containing the tests and assertions. Remove the separate scenario crate and registry, and split lifecycle coverage into independent stop/start and stopped-deletion stories. Reuse shared helpers from the existing Rust harness, preserve artifact packaging and focused test selection, and include tooling and pure assertion tests in test:rust and branch checks. Update authoring guidance for required behavior and retained failures with explicit waivers. Closes #4119 Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 3a2d0cf commit 846fa93

63 files changed

Lines changed: 2407 additions & 1939 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ jobs:
141141
shell: nix develop -c bash -euo pipefail {0}
142142
run: |
143143
cargo fmt --all -- --check
144+
cargo fmt --manifest-path e2e/support/rust/Cargo.toml --all -- --check
145+
cargo fmt --manifest-path e2e/suites/conformance/Cargo.toml --all -- --check
144146
cargo fmt --manifest-path e2e/rust/Cargo.toml --all -- --check
145147
cargo fmt --manifest-path examples/governance-interceptor/Cargo.toml --all -- --check
146148
cargo fmt --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all -- --check
@@ -196,6 +198,8 @@ jobs:
196198
shell: nix develop -c bash -euo pipefail {0}
197199
run: |
198200
cargo clippy --locked --workspace --all-targets -- -D warnings
201+
cargo clippy --locked --manifest-path e2e/support/rust/Cargo.toml --workspace --all-targets -- -D warnings
202+
cargo clippy --locked --manifest-path e2e/suites/conformance/Cargo.toml --workspace --all-targets -- -D warnings
199203
cargo clippy --locked --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings
200204
cargo clippy --locked --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings
201205
cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings
@@ -235,6 +239,8 @@ jobs:
235239
OPENSHELL_TELEMETRY_ENABLED: "false"
236240
run: |
237241
cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support
242+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path e2e/support/rust/Cargo.toml
243+
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path e2e/suites/conformance/Cargo.toml --package openshell-test-conformance-cli -E 'binary(policy_advisor) & test(draft_assertion::tests::)'
238244
cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml
239245
240246
rust-build-modes:

‎AGENTS.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Do not rely on this file for a full inventory. The detailed public and contribut
2222
| Path | Components | Purpose |
2323
|------|-----------|---------|
2424
| `crates/openshell-cli/` | CLI binary | User-facing command-line interface |
25-
| `crates/openshell-conformance/` | CLI conformance library | Reusable driver-agnostic scenarios and command runner |
2625
| `crates/openshell-server/` | Gateway server | Control-plane API, sandbox lifecycle, auth boundary |
2726
| `crates/openshell-sandbox/` | Sandbox runtime | Capability-free workload launcher, process identity, and seccomp-mediated I/O |
2827
| `crates/openshell-supervisor/` | Supervisor runtime | Gateway session, policy evaluation, credentials, and upstream networking |
@@ -61,6 +60,9 @@ Do not rely on this file for a full inventory. The detailed public and contribut
6160
| `python/openshell/` | Python SDK | Python bindings and CLI packaging |
6261
| `sdk/typescript/` | TypeScript SDK | Native Connect client, curated sandbox API, and generated protobuf types |
6362
| `proto/` | Protobuf definitions | gRPC service contracts |
63+
| `e2e/suites/` | Behavioral E2E suites | Conformance scenarios, feature tests, and driver tests |
64+
| `e2e/support/rust/` | Shared Rust test tooling | CLI runner, binary resolution, output parsing, and port utilities |
65+
| `tests/` | Test provisioning | Target configuration, artifact construction, and Ansible setup |
6466
| `deploy/` | Docker, Helm, K8s | Dockerfiles, Helm chart, manifests |
6567
| `docs/` | Published docs | MDX pages, navigation, and content assets |
6668
| `fern/` | Docs site config | Fern site config, components, and theme assets |

‎CI.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,14 @@ merge.
522522
Do not add the informational Actionlint, Zizmor, Dependency Review, or CodeQL
523523
jobs to the required status list while they remain in observation mode.
524524

525+
## Conformance source checks
526+
527+
Branch Rust checks format and lint the separate
528+
`e2e/suites/conformance` workspace and shared tooling in `e2e/support/rust`.
529+
The Rust test jobs run the shared tooling and select the pure policy assertion
530+
tests in the conformance CLI package with the CI nextest profile, without a gateway. Gateway-backed CLI tests retain their driver E2E and installed-artifact
531+
integration lanes; source unit-test jobs do not execute those entry points.
532+
525533
## Nix download recovery
526534

527535
Jobs that enter the development shell enable `prepare-shell: "true"` on

‎Cargo.lock‎

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎TESTING.md‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,32 @@ mise run e2e # End-to-end tests (starts a Docker-backed gateway)
88
mise run ci # Everything: lint, compile checks, and tests
99
```
1010

11+
## Test Families
12+
13+
- Lint checks formatting, style, and static rules.
14+
- Unit tests verify a component in isolation.
15+
- Integration tests verify interactions between components.
16+
- End-to-end tests exercise a configured OpenShell target through a client.
17+
- Benchmarks measure performance or scale separately from behavioral correctness.
18+
19+
End-to-end suites under `e2e/suites/` are grouped by intent: conformance verifies
20+
required public behavior, feature suites need a named external service or special
21+
gateway configuration, and driver suites verify driver or host integration.
22+
The [conformance guide](e2e/suites/conformance/README.md) owns conformance
23+
requirements, authoring, and execution guidance. Existing mixed suites remain
24+
under `e2e/rust/` while their behavior is migrated. `tests/` supplies provisioning
25+
and artifact construction independently of the suite layout.
26+
1127
## Test Layout
1228

1329
```text
1430
crates/*/src/ # Inline #[cfg(test)] modules
1531
crates/*/tests/ # Rust integration tests
1632
python/openshell/ # Python unit tests (*_test.py suffix)
1733
e2e/python/ # Python E2E tests (test_*.py prefix)
18-
e2e/rust/ # Rust CLI E2E tests
34+
e2e/rust/ # Legacy Rust CLI E2E tests awaiting migration
35+
e2e/suites/ # Conformance, feature, and driver E2E suites
36+
tests/ # Target provisioning and artifact construction
1937
```
2038

2139
## Rust Tests
@@ -210,10 +228,15 @@ When more than one test needs this behavior, put the transport in the shared
210228
Rust e2e harness and require callers to use it instead of duplicating DNS,
211229
HTTP `Host`, TLS SNI, and mTLS handling.
212230

231+
Shared Rust test tooling lives under `e2e/support/rust`, including the CLI runner,
232+
binary resolution, output parsing, and port utilities. Conformance scenarios live
233+
under `e2e/suites/conformance/cli/tests`. `mise run test:rust` includes the tooling
234+
and scenario unit tests without requiring a gateway.
235+
213236
Suites:
214237

215238
- Common suite (`--features e2e`) - driver-neutral CLI behavior, sandbox lifecycle, sync, port forwarding, policy, and provider tests.
216-
- CLI conformance (`tests/suites/conformance`) - portable Cargo tests for
239+
- CLI conformance (`e2e/suites/conformance`) - portable Cargo tests for
217240
lifecycle, mechanistic drafts, file transfer, and the sandbox-local API,
218241
including agent-authored permission requests. Driver E2E runs the complete
219242
Cargo test package. The installed-artifact conformance suite runs the same
@@ -251,7 +274,7 @@ cargo build --package openshell-cli
251274
OPENSHELL_BIN="$PWD/target/debug/openshell" \
252275
cargo test \
253276
--locked \
254-
--manifest-path tests/suites/conformance/Cargo.toml \
277+
--manifest-path e2e/suites/conformance/Cargo.toml \
255278
--package openshell-test-conformance-cli \
256279
--no-fail-fast \
257280
-- \

‎crates/openshell-conformance/Cargo.toml‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)