Skip to content

Commit 2ef7f20

Browse files
committed
test(e2e): clarify backend-specific task names
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent f17806c commit 2ef7f20

7 files changed

Lines changed: 115 additions & 30 deletions

File tree

.github/workflows/e2e-gpu-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ jobs:
7979
run: mise run --no-deps --skip-deps cluster
8080

8181
- name: Run tests
82-
run: mise run --no-deps --skip-deps e2e:python:gpu
82+
run: mise run --no-deps --skip-deps e2e:k3s:gpu

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
matrix:
2828
include:
2929
- suite: python
30-
cmd: "mise run --no-deps --skip-deps e2e:python"
30+
cmd: "mise run --no-deps --skip-deps e2e:docker:python"
3131
- suite: rust
32-
cmd: "mise run --no-deps --skip-deps e2e:rust"
32+
cmd: "mise run --no-deps --skip-deps e2e:docker:rust"
3333
container:
3434
image: ghcr.io/nvidia/openshell/ci:latest
3535
credentials:

TESTING.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
```bash
66
mise run test # Rust + Python unit tests
7-
mise run e2e # End-to-end tests (starts a Docker-backed gateway)
7+
mise run e2e # Docker-backed end-to-end tests
8+
mise run e2e:docker # Same as e2e, explicit Docker-backed suite
9+
mise run e2e:k3s:gpu # GPU E2E against the OpenShell k3s-cluster gateway
810
mise run ci # Everything: lint, compile checks, and tests
911
```
1012

@@ -96,6 +98,12 @@ def test_exec_returns_stdout(sandbox):
9698
assert "hello" in result.stdout
9799
```
98100

101+
Run Docker-backed Python e2e tests:
102+
103+
```bash
104+
mise run e2e:docker:python
105+
```
106+
99107
#### `Sandbox.exec_python`
100108

101109
`exec_python` serializes a Python callable with `cloudpickle`, sends it to the
@@ -154,7 +162,7 @@ Tests:
154162
Run all CLI e2e tests:
155163

156164
```bash
157-
mise run e2e:rust
165+
mise run e2e:docker:rust
158166
```
159167

160168
Run a single test directly with cargo:
@@ -163,6 +171,25 @@ Run a single test directly with cargo:
163171
cargo test --manifest-path e2e/rust/Cargo.toml --features e2e --test sync
164172
```
165173

174+
Run a single Rust e2e test target with the Docker-backed gateway wrapper:
175+
176+
```bash
177+
OPENSHELL_E2E_RUST_TEST=smoke mise run e2e:docker:rust
178+
OPENSHELL_E2E_RUST_TEST=sync mise run e2e:docker:rust
179+
```
180+
181+
Run only the Docker-backed smoke test:
182+
183+
```bash
184+
mise run e2e:docker:smoke
185+
```
186+
187+
Run GPU E2E against the OpenShell k3s-cluster gateway:
188+
189+
```bash
190+
mise run e2e:k3s:gpu
191+
```
192+
166193
The harness (`e2e/rust/src/harness/`) provides:
167194

168195
| Module | Purpose |
@@ -178,3 +205,4 @@ The harness (`e2e/rust/src/harness/`) provides:
178205
|---|---|
179206
| `OPENSHELL_GATEWAY` | Override active gateway name for E2E tests |
180207
| `OPENSHELL_GATEWAY_ENDPOINT` | Run E2E tests against an existing plaintext HTTP gateway endpoint |
208+
| `OPENSHELL_E2E_RUST_TEST` | Run one Rust E2E integration test target, for example `smoke` or `sync` |

e2e/rust/e2e-docker.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

5-
# Run a Rust e2e test against a standalone gateway running the bundled Docker
6-
# compute driver. Set OPENSHELL_GATEWAY_ENDPOINT=http://host:port to reuse an
7-
# existing plaintext gateway instead of starting an ephemeral one.
5+
# Backward-compatible wrapper for the Docker Rust e2e smoke path.
6+
#
7+
# Prefer e2e-rust.sh with OPENSHELL_E2E_RUST_TEST for new task wiring.
88

99
set -euo pipefail
1010

1111
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12-
E2E_TEST="${OPENSHELL_E2E_DOCKER_TEST:-smoke}"
1312

14-
cargo build -p openshell-cli --features openshell-core/dev-settings
13+
export OPENSHELL_E2E_RUST_TEST="${OPENSHELL_E2E_RUST_TEST:-${OPENSHELL_E2E_DOCKER_TEST:-smoke}}"
1514

16-
exec "${ROOT}/e2e/with-docker-gateway.sh" \
17-
cargo test --manifest-path "${ROOT}/e2e/rust/Cargo.toml" \
18-
--features e2e \
19-
--test "${E2E_TEST}" \
20-
-- --nocapture
15+
exec "${ROOT}/e2e/rust/e2e-rust.sh"

e2e/rust/e2e-rust.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Run Rust e2e tests against a standalone gateway running the bundled Docker
6+
# compute driver. Set OPENSHELL_E2E_RUST_TEST to a Rust integration test target
7+
# such as "smoke" or "sync" to run only that file.
8+
9+
set -euo pipefail
10+
11+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12+
E2E_TEST="${OPENSHELL_E2E_RUST_TEST:-}"
13+
14+
cargo build -p openshell-cli --features openshell-core/dev-settings
15+
16+
cargo_args=(
17+
test
18+
--manifest-path "${ROOT}/e2e/rust/Cargo.toml"
19+
--features e2e
20+
)
21+
22+
test_args=()
23+
24+
if [ -n "${E2E_TEST}" ]; then
25+
cargo_args+=(--test "${E2E_TEST}")
26+
test_args+=(--nocapture)
27+
else
28+
test_args+=(--skip docker_gpu_sandbox_runs_nvidia_smi)
29+
fi
30+
31+
exec "${ROOT}/e2e/with-docker-gateway.sh" cargo "${cargo_args[@]}" -- "${test_args[@]}"

mise.lock

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

tasks/test.toml

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ description = "Run all tests (Rust + Python)"
88
depends = ["test:rust", "test:python"]
99

1010
[e2e]
11-
description = "Run all end-to-end tests (Rust + Python)"
12-
depends = ["e2e:rust", "e2e:python"]
11+
description = "Run all Docker-backed end-to-end tests (Rust + Python)"
12+
depends = ["e2e:docker"]
1313

1414
["e2e:gpu"]
15-
description = "Run GPU end-to-end tests"
16-
depends = ["e2e:python:gpu"]
15+
description = "Alias for e2e:k3s:gpu"
16+
run = [
17+
"echo 'warning: e2e:gpu is deprecated; use e2e:k3s:gpu' >&2",
18+
"mise run e2e:k3s:gpu",
19+
]
20+
hide = true
1721

1822
["test:rust"]
1923
description = "Run Rust tests"
@@ -28,20 +32,31 @@ run = "uv run pytest python/"
2832
hide = true
2933

3034
["e2e:rust"]
31-
description = "Run Rust CLI e2e tests against a Docker-backed gateway"
35+
description = "Alias for e2e:docker:rust"
3236
run = [
33-
"cargo build -p openshell-cli --features openshell-core/dev-settings",
34-
"e2e/with-docker-gateway.sh cargo test --manifest-path e2e/rust/Cargo.toml --features e2e -- --skip docker_gpu_sandbox_runs_nvidia_smi",
37+
"echo 'warning: e2e:rust is deprecated; use e2e:docker:rust' >&2",
38+
"mise run e2e:docker:rust",
3539
]
40+
hide = true
3641

3742
["e2e:python"]
38-
description = "Run Python e2e tests against a Docker-backed gateway (E2E_PARALLEL=N or 'auto'; default 5)"
39-
depends = ["python:proto"]
40-
env = { UV_NO_SYNC = "1", PYTHONPATH = "python" }
41-
run = "e2e/with-docker-gateway.sh uv run pytest -o python_files='test_*.py' -m 'not gpu' -n ${E2E_PARALLEL:-5} e2e/python"
43+
description = "Alias for e2e:docker:python"
44+
run = [
45+
"echo 'warning: e2e:python is deprecated; use e2e:docker:python' >&2",
46+
"mise run e2e:docker:python",
47+
]
48+
hide = true
4249

4350
["e2e:python:gpu"]
44-
description = "Run Python GPU e2e tests"
51+
description = "Alias for e2e:k3s:gpu"
52+
run = [
53+
"echo 'warning: e2e:python:gpu is deprecated; use e2e:k3s:gpu' >&2",
54+
"mise run e2e:k3s:gpu",
55+
]
56+
hide = true
57+
58+
["e2e:k3s:gpu"]
59+
description = "Run GPU e2e tests against an OpenShell k3s-cluster gateway"
4560
depends = ["python:proto", "CLUSTER_GPU=1 cluster"]
4661
env = { UV_NO_SYNC = "1", PYTHONPATH = "python" }
4762
run = "uv run pytest -o python_files='test_*.py' -m gpu -n ${E2E_PARALLEL:-1} e2e/python"
@@ -56,10 +71,25 @@ description = "Start openshell-gateway with the VM compute driver and run the cl
5671
run = "e2e/rust/e2e-vm.sh"
5772

5873
["e2e:docker"]
74+
description = "Run all Docker-backed end-to-end tests (Rust + Python)"
75+
depends = ["e2e:docker:rust", "e2e:docker:python"]
76+
77+
["e2e:docker:rust"]
78+
description = "Run Rust CLI e2e tests against a Docker-backed gateway"
79+
run = "e2e/rust/e2e-rust.sh"
80+
81+
["e2e:docker:python"]
82+
description = "Run Python e2e tests against a Docker-backed gateway (E2E_PARALLEL=N or 'auto'; default 5)"
83+
depends = ["python:proto"]
84+
env = { UV_NO_SYNC = "1", PYTHONPATH = "python" }
85+
run = "e2e/with-docker-gateway.sh uv run pytest -o python_files='test_*.py' -m 'not gpu' -n ${E2E_PARALLEL:-5} e2e/python"
86+
87+
["e2e:docker:smoke"]
5988
description = "Run smoke e2e against a standalone gateway with the Docker compute driver"
60-
run = "e2e/rust/e2e-docker.sh"
89+
env = { OPENSHELL_E2E_RUST_TEST = "smoke" }
90+
run = "e2e/rust/e2e-rust.sh"
6191

6292
["e2e:docker:gpu"]
6393
description = "Run GPU e2e against a standalone gateway with the Docker compute driver"
64-
env = { OPENSHELL_E2E_DOCKER_GPU = "1", OPENSHELL_E2E_DOCKER_TEST = "docker_gpu" }
65-
run = "e2e/rust/e2e-docker.sh"
94+
env = { OPENSHELL_E2E_DOCKER_GPU = "1", OPENSHELL_E2E_RUST_TEST = "docker_gpu" }
95+
run = "e2e/rust/e2e-rust.sh"

0 commit comments

Comments
 (0)