Skip to content

Commit abcda69

Browse files
ci(e2e): freeze new legacy Rust E2E tests
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent 8b3f375 commit abcda69

4 files changed

Lines changed: 90 additions & 2 deletions

File tree

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,37 @@ jobs:
630630

631631
- name: Test accepted-work library, review-readiness, and issue labeling
632632
run: "mise run test:accepted-work ::: test:review-readiness ::: test:label-issue"
633+
e2e-rust-freeze:
634+
name: Rust E2E Freeze
635+
if: github.event_name == 'pull_request'
636+
runs-on: ubuntu-latest
637+
timeout-minutes: 5
638+
permissions:
639+
contents: read
640+
pull-requests: read
641+
steps:
642+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
643+
with:
644+
fetch-depth: 0
645+
persist-credentials: false
646+
647+
- name: Reject new Rust E2E tests
648+
env:
649+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
650+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
651+
PR_NUMBER: ${{ github.event.pull_request.number }}
652+
GH_TOKEN: ${{ github.token }}
653+
run: |
654+
set -euo pipefail
655+
# Read current labels so a rerun picks up a maintainer's decision.
656+
exception=$(gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}" \
657+
--jq 'any(.labels[]; .name == "test:e2e-rust-exception")')
658+
if [[ "$exception" == true ]]; then
659+
echo "Maintainer exception: test:e2e-rust-exception"
660+
exit 0
661+
fi
662+
bash tasks/scripts/check-e2e-rust-freeze.sh "$BASE_SHA" "$HEAD_SHA"
663+
633664
python-sdk-freeze:
634665
# The Python SDK moved to ai-openshell/sdk-python (#5287), which imported it
635666
# at v0.1.7. Its files stay only until core removes them, so PRs must not

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ ocsf_emit!(event);
164164
## Sandbox Infra Changes
165165

166166
- If you change sandbox infrastructure, ensure the relevant sandbox e2e path succeeds.
167+
- For new E2E tests, see [Where a new test goes](TESTING.md#where-a-new-test-goes).
167168

168169
## Network Sockets
169170

‎TESTING.md‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ and `run` commands in the guest and still writes `junit.xml` and `nextest.log`
259259
`openshell-test-runner build --family <family> --out <dir>` builds a family's
260260
test bundle for the guest without booting a VM, and `run --bundle <dir>` runs
261261
it instead of building one. `--package` then selects the tests to run from the
262-
bundle, which must hold those packages. Branch E2E builds the `features` and
263-
`drivers/podman` bundles once and passes them to their rows this way. Two runs on one host
262+
bundle, which must hold those packages. Branch E2E builds the feature and driver
263+
bundles once and passes them to their rows this way. Two runs on one host
264264
need different `TMACHINE_SSH_PORT` values (default 2222). The installer
265265
inputs, such as the Debian package and the images, come from `artifacts/`,
266266
built by `nix run .#build-artifacts` or downloaded by CI.
@@ -449,8 +449,25 @@ def test_multiply(sandbox):
449449
| `sandbox_client` | session | gRPC client connected to the active gateway |
450450
| `sandbox` | function | Factory returning a `Sandbox` context manager |
451451

452+
### Where a new test goes
453+
454+
| If the test needs… | Put it here |
455+
|---|---|
456+
| A public contract that applies to every driver | `tests/suites/conformance` |
457+
| A service or fixed gateway setting | `tests/suites/features/<name>`; add a tmachine add-on if the setup is missing (see [Adding a feature suite](#adding-a-feature-suite)) |
458+
| Driver-specific behavior | `tests/suites/drivers/{docker,podman,kubernetes,vm}`. Kubernetes runs on `k3s` and `k3s-ha`; VM runs on the existing VM host lane. |
459+
| A GPU or a gateway restart or reconfiguration during the test | No home yet. Use [continuity suites](#continuity-suites-testssuitescontinuity) if the runner can apply the disruption between test phases. |
460+
461+
For a GPU or mid-test restart or reconfiguration case that cannot move yet,
462+
link a porting issue under [#5281](https://github.com/ai-openshell/openshell/issues/5281)
463+
and ask a maintainer for `test:e2e-rust-exception`. After a label change, rerun
464+
the Rust E2E Freeze job so it reads the current labels.
465+
452466
### Rust CLI E2E (`e2e/rust/`)
453467

468+
This tree is frozen to new tests. You can edit or delete existing tests.
469+
See [Where a new test goes](#where-a-new-test-goes) for alternatives.
470+
454471
Rust-based e2e tests that exercise the `openshell` CLI binary as a subprocess.
455472
They live in the `openshell-e2e` crate and use a shared harness for sandbox
456473
lifecycle management, output parsing, and cleanup.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
set -euo pipefail
6+
7+
base=$(git merge-base "$1" "$2")
8+
head=$2
9+
10+
# Treat a move into the frozen tree like any other new file.
11+
new_files=$(git diff --no-renames --name-only --diff-filter=A "$base" "$head" -- e2e/rust/tests/)
12+
13+
# Scan added lines only; hunk headers and context must not count. Match
14+
# parameterized Tokio attributes too, including when their arguments wrap.
15+
new_attributes=$(git diff --no-renames --no-ext-diff --no-textconv --no-color --no-prefix --text \
16+
--unified=0 "$base" "$head" -- e2e/rust/ |
17+
awk '
18+
/^diff --git / { path = ""; in_hunk = 0 }
19+
/^\+\+\+ / && !in_hunk { path = substr($0, 5) }
20+
/^@@ / { in_hunk = 1 }
21+
in_hunk && /^\+[[:space:]]*#[[:space:]]*\[[[:space:]]*(test[[:space:]]*\]|tokio[[:space:]]*::[[:space:]]*test[[:space:]]*(\]|\())/ {
22+
print " " path ": " substr($0, 2)
23+
}
24+
')
25+
26+
if [[ -z "$new_files" && -z "$new_attributes" ]]; then
27+
exit 0
28+
fi
29+
30+
echo "::error title=Rust E2E Freeze::e2e/rust is frozen to new tests. See TESTING.md: Where a new test goes." >&2
31+
if [[ -n "$new_files" ]]; then
32+
echo "New files under e2e/rust/tests:" >&2
33+
printf ' %s\n' "${new_files//$'\n'/$'\n '}" >&2
34+
fi
35+
if [[ -n "$new_attributes" ]]; then
36+
echo "New test attributes under e2e/rust:" >&2
37+
echo "$new_attributes" >&2
38+
fi
39+
exit 1

0 commit comments

Comments
 (0)