Skip to content

Commit 335b095

Browse files
committed
chore(e2e): remove the Python E2E suites
Every case in e2e/python now maps to Rust coverage or an explicit drop (#5435). The SDK-client suites (exec admission, sandbox API, exec_python, workspace API) run in ai-openshell/sdk-python against published core gateways. - Delete e2e/python and the e2e:python and e2e:oidc-python:docker tasks; e2e no longer depends on python:proto or PYTHONPATH=python. - Move the workload image's Dockerfile to e2e/workload/Dockerfile. The image tag and contents are unchanged; testkit, the Rust harness and tmachine keep using openshell/e2e-python:dev. - Docker E2E: replace the python and oidc-python rows with gateway-mtls, drop the python:proto setup step, and run oidc_authz in the oidc-pkce lanes. Add a gateway-mtls row on the deb tmachine gateway. - Update TESTING.md and the testkit docs. Refs #5435; python/ itself is removed by #5287. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 022af8d commit 335b095

25 files changed

Lines changed: 45 additions & 5321 deletions

‎.github/workflows/e2e-docker-test.yml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
required: false
3030
type: string
3131
default: >-
32-
[{"suite":"python","cmd":"mise run --no-deps --skip-deps e2e:python","apt_packages":"","python_proto":true,"mcp":false},{"suite":"oidc-python","cmd":"mise run --no-deps --skip-deps e2e:oidc-python:docker","apt_packages":"","python_proto":true,"mcp":false},{"suite":"oidc-pkce-docker","cmd":"mise run --no-deps --skip-deps e2e:oidc-pkce:docker","apt_packages":"openssh-client","python_proto":false,"mcp":false},{"suite":"rust-docker","cmd":"mise run --no-deps --skip-deps e2e:rust","apt_packages":"openssh-client","python_proto":false,"mcp":false},{"suite":"rust-docker-push","cmd":"mise run --no-deps --skip-deps e2e:rust:push","apt_packages":"openssh-client","python_proto":false,"mcp":false},{"suite":"oci-image","cmd":"mise run --no-deps --skip-deps e2e:oci-image","apt_packages":"openssh-client","python_proto":false,"mcp":false},{"suite":"additional-ca","cmd":"OPENSHELL_E2E_DOCKER_TEST=additional_ca mise run --no-deps --skip-deps e2e:docker","apt_packages":"openssh-client","python_proto":false,"mcp":false},{"suite":"middleware-http-hooks","cmd":"mise run --no-deps --skip-deps e2e:middleware-http-hooks","apt_packages":"","python_proto":false,"mcp":false},{"suite":"mcp","cmd":"mise run --no-deps --skip-deps e2e:mcp","apt_packages":"","python_proto":false,"mcp":true}]
32+
[{"suite":"oidc-pkce-docker","cmd":"mise run --no-deps --skip-deps e2e:oidc-pkce:docker","apt_packages":"openssh-client","mcp":false},{"suite":"rust-docker","cmd":"mise run --no-deps --skip-deps e2e:rust","apt_packages":"openssh-client","mcp":false},{"suite":"gateway-mtls","cmd":"mise run --no-deps --skip-deps e2e:gateway-mtls","apt_packages":"","mcp":false},{"suite":"rust-docker-push","cmd":"mise run --no-deps --skip-deps e2e:rust:push","apt_packages":"openssh-client","mcp":false},{"suite":"oci-image","cmd":"mise run --no-deps --skip-deps e2e:oci-image","apt_packages":"openssh-client","mcp":false},{"suite":"additional-ca","cmd":"OPENSHELL_E2E_DOCKER_TEST=additional_ca mise run --no-deps --skip-deps e2e:docker","apt_packages":"openssh-client","mcp":false},{"suite":"middleware-http-hooks","cmd":"mise run --no-deps --skip-deps e2e:middleware-http-hooks","apt_packages":"","mcp":false},{"suite":"mcp","cmd":"mise run --no-deps --skip-deps e2e:mcp","apt_packages":"","mcp":true}]
3333
3434
permissions:
3535
actions: read
@@ -97,10 +97,6 @@ jobs:
9797
- name: Log in to GHCR
9898
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${GITHUB_ACTOR}" --password-stdin
9999

100-
- name: Install Python dependencies and generate protobuf stubs
101-
if: matrix.python_proto
102-
run: uv sync --frozen && mise run --no-deps python:proto
103-
104100
- name: Run tests
105101
env:
106102
OPENSHELL_MCP_CONFORMANCE_CLIENT_IMAGE: ${{ format('openshell-mcp-conformance-client:{0}', inputs.image-tag) }}

‎.github/workflows/e2e-suites.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
{"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
9797
{"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
9898
{"environment":"ubuntu-docker-rootful-keycloak","installer":"deb","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
99+
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"gateway-mtls","gateway":"openshell","runner":"ubuntu-24.04"},
99100
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
100101
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
101102
{"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},

‎TESTING.md‎

Lines changed: 27 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mise run ci # Everything: lint, compile checks, and tests
1414
crates/*/src/ # Inline #[cfg(test)] modules
1515
crates/*/tests/ # Rust integration tests
1616
python/openshell/ # Python unit tests (*_test.py suffix)
17-
e2e/python/ # Python E2E tests (test_*.py prefix)
17+
e2e/workload/ # Workload image the E2E sandboxes run python3, curl, and git from
1818
e2e/rust/ # Rust CLI E2E tests
1919
tests/testkit/ # Support library for SDK-driven E2E suites
2020
tests/suites/ # E2E suites, grouped by test family
@@ -350,73 +350,23 @@ can run the suite. The expectations characterize the sandbox's behavior today,
350350
not a specification, and the `echo-socket` check needs `perl` in the workload
351351
image, which the default image has.
352352

353-
### Python E2E (`e2e/python/`)
353+
### E2E workload image (`e2e/workload/`)
354354

355-
`mise run e2e:python` builds `openshell/e2e-python:dev` from
356-
`e2e/python/Dockerfile.workload` and selects it only for the test gateway.
357-
This Noble-based fixture supplies the `sandbox` user, Python tooling, Git,
358-
and a writable `/sandbox/.venv`. Its Python version comes from `.python-version`
359-
so cloudpickle code objects match the test runner. The production workload
355+
`mise run e2e:workload:build` builds `openshell/e2e-python:dev` from
356+
`e2e/workload/Dockerfile`; `testkit::python_image()` and the Rust Docker
357+
harness select it for tests that need Python, Git, curl, openssl, or the
358+
`sandbox` user. This Noble-based fixture also has a writable `/sandbox/.venv`.
359+
Its Python version comes from `.python-version`. The production workload
360360
default remains the unmodified NVIDIA Ubuntu image.
361361

362-
The Rust Docker harness also selects this fixture for tests that need tools
363-
or the named user. Explicit `--from` or `--template` arguments and the default-image
364-
tests retain their own image selection. Docker sandbox and support-container
365-
fixtures use the fixed image name; no workload-image override is needed.
366-
Podman, VM, and Kubernetes retain their existing pinned, pullable fixture and
367-
image setup. Conformance-only runs do not need the Docker fixture.
368-
Build the Docker fixture separately with `mise run e2e:workload:build`.
362+
Explicit `--from` or `--template` arguments and the default-image tests retain
363+
their own image selection. Docker sandbox and support-container fixtures use
364+
the fixed image name; no workload-image override is needed. Podman, VM, and
365+
Kubernetes retain their existing pinned, pullable fixture and image setup.
369366

370-
Tests use the `sandbox` fixture from `conftest.py` to create real sandboxes:
371-
372-
```python
373-
def test_exec_returns_stdout(sandbox):
374-
with sandbox(delete_on_exit=True) as sb:
375-
result = sb.exec(["echo", "hello"])
376-
assert result.exit_code == 0
377-
assert "hello" in result.stdout
378-
```
379-
380-
#### `Sandbox.exec_python`
381-
382-
`exec_python` serializes a Python callable with `cloudpickle`, sends it to the
383-
sandbox, and returns the result. Because cloudpickle serializes module-level
384-
functions by reference (which fails inside the sandbox), use one of these
385-
patterns:
386-
387-
**Closures from factory functions:**
388-
389-
```python
390-
def _make_adder():
391-
def add(a, b):
392-
return a + b
393-
return add
394-
395-
def test_addition(sandbox):
396-
with sandbox(delete_on_exit=True) as sb:
397-
result = sb.exec_python(_make_adder(), args=(2, 3))
398-
assert result.stdout.strip() == "5"
399-
```
400-
401-
**Bound methods on local classes:**
402-
403-
```python
404-
def test_multiply(sandbox):
405-
class Calculator:
406-
def multiply(self, a, b):
407-
return a * b
408-
409-
with sandbox(delete_on_exit=True) as sb:
410-
result = sb.exec_python(Calculator().multiply, args=(6, 7))
411-
assert result.stdout.strip() == "42"
412-
```
413-
414-
#### Shared Fixtures (`e2e/python/conftest.py`)
415-
416-
| Fixture | Scope | Purpose |
417-
|---|---|---|
418-
| `sandbox_client` | session | gRPC client connected to the active gateway |
419-
| `sandbox` | function | Factory returning a `Sandbox` context manager |
367+
Core has no Python E2E suite. The Python SDK's own E2E suite lives in
368+
[ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python) and runs
369+
against published core gateways.
420370

421371
### Rust CLI E2E (`e2e/rust/`)
422372

@@ -458,7 +408,8 @@ Suites:
458408
- Common suite (`--features e2e`) - driver-neutral CLI behavior, sandbox lifecycle, sync, port forwarding, policy, and provider tests.
459409
- Conformance (`tests/suites/conformance`) - the testkit `conformance` crate:
460410
lifecycle, the CLI, persistent workspaces, file transfer, the policy
461-
advisor, and credential gating. Driver E2E runs it with
411+
advisor, credential gating, policy validation and enforcement (Landlock and
412+
denied connections), and provider credential placement. Driver E2E runs it with
462413
`openshell-conformance` against the lane's gateway and writes a JUnit report
463414
under `results/`; set `OPENSHELL_CONFORMANCE_BIN` to use a prebuilt program,
464415
as Branch E2E does with the static build it makes once per architecture.
@@ -661,6 +612,17 @@ supervises its `ssh` process: it reconnects after losing the SSH transport and
661612
forwards a SIGTERM to `ssh`. The tests find those processes in `/proc`, so they
662613
need a Linux test host. CI runs them on Docker rootful.
663614

615+
The `gateway-mtls` feature suite (`tests/suites/features/gateway-mtls`) checks
616+
an mTLS gateway's user boundary: a client certificate from the gateway's CA
617+
authenticates a user, a CA-only client reaches only Health, and a foreign
618+
certificate or plaintext connection is refused. CI runs it against the deb
619+
gateway on Docker rootful and in the Docker E2E workflow. Run it against a
620+
local Docker gateway:
621+
622+
```shell
623+
mise run e2e:gateway-mtls
624+
```
625+
664626
Run the VM-backed Rust CLI e2e suite:
665627

666628
```shell

‎e2e/python/conftest.py‎

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

‎e2e/python/oidc/__init__.py‎

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

‎e2e/python/oidc/conftest.py‎

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

0 commit comments

Comments
 (0)