Skip to content

Commit 9123110

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 b3e9412 commit 9123110

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
@@ -91,6 +91,7 @@ jobs:
9191
{"environment":"fedora-podman-rootful-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
9292
{"environment":"fedora-podman-rootless-cdi","installer":"rpm","family":"features","package":"cdi","gateway":"openshell","runner":"ubuntu-24.04"},
9393
{"environment":"ubuntu-docker-rootful-keycloak","installer":"deb","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
94+
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"gateway-mtls","gateway":"openshell","runner":"ubuntu-24.04"},
9495
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
9596
{"environment":"fedora-podman-rootful","installer":"rpm","family":"features","package":"oci-image","gateway":"openshell","runner":"ubuntu-24.04"},
9697
{"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
@@ -345,73 +345,23 @@ can run the suite. The expectations characterize the sandbox's behavior today,
345345
not a specification, and the `echo-socket` check needs `perl` in the workload
346346
image, which the default image has.
347347

348-
### Python E2E (`e2e/python/`)
348+
### E2E workload image (`e2e/workload/`)
349349

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

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

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

416366
### Rust CLI E2E (`e2e/rust/`)
417367

@@ -453,7 +403,8 @@ Suites:
453403
- Common suite (`--features e2e`) - driver-neutral CLI behavior, sandbox lifecycle, sync, port forwarding, policy, and provider tests.
454404
- Conformance (`tests/suites/conformance`) - the testkit `conformance` crate:
455405
lifecycle, the CLI, persistent workspaces, file transfer, the policy
456-
advisor, and credential gating. Driver E2E runs it with
406+
advisor, credential gating, policy validation and enforcement (Landlock and
407+
denied connections), and provider credential placement. Driver E2E runs it with
457408
`openshell-conformance` against the lane's gateway and writes a JUnit report
458409
under `results/`; set `OPENSHELL_CONFORMANCE_BIN` to use a prebuilt program,
459410
as Branch E2E does with the static build it makes once per architecture.
@@ -650,6 +601,17 @@ rootful and rootless, and the `k3s` and `k3s-ha` installers. The tests run on
650601
the K3s node, so the K3s installers set the chart's `server.hostGatewayIP` to
651602
the node's address.
652603

604+
The `gateway-mtls` feature suite (`tests/suites/features/gateway-mtls`) checks
605+
an mTLS gateway's user boundary: a client certificate from the gateway's CA
606+
authenticates a user, a CA-only client reaches only Health, and a foreign
607+
certificate or plaintext connection is refused. CI runs it against the deb
608+
gateway on Docker rootful and in the Docker E2E workflow. Run it against a
609+
local Docker gateway:
610+
611+
```shell
612+
mise run e2e:gateway-mtls
613+
```
614+
653615
Run the VM-backed Rust CLI e2e suite:
654616

655617
```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)