Skip to content

test(e2e): run the SDK E2E suite against the pinned core gateway - #12

Merged
pimlock merged 3 commits into
mainfrom
feat/6-e2e/pimlock
Nov 9, 2026
Merged

pimlock merged 3 commits into
mainfrom
feat/6-e2e/pimlock

Conversation

@pimlock

@pimlock pimlock commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the E2E lane: the SDK's tests from core's e2e/python now run here against the published gateway of the pinned core version (v0.1.7). The workflow and gateway scripts are ported from sdk-go, so a core bump PR (#5) can run the same check with its proposed version.

Stacked on #3; review that first. This PR retargets to main when #3 merges.

Related Issue

Closes #6. Part of NVIDIA/OpenShell#5287.

Changes

  • Suite (tests/e2e/): sandbox_api, workspace_api, sandbox_exec_python and exec_admission from core at v0.1.7, renamed to this repository's *_test.py pattern. The only change is one ruff reformat.

    • conftest.py keeps only the fixtures these tests use. It skips every test when OPENSHELL_GATEWAY isn't set.
    • The tests still call client._stub where the curated API has no wrapper: interactive exec, start and stop, UpdateConfig, and request IDs on create, delete and exec.
  • Sandbox image: tests/e2e/Dockerfile.workload is a copy of core's. mise run e2e:image builds it with the Python version from .python-version and adds cloudpickle, which exec_python needs. conformance:check also fails when this copy drifts from core at the pin.

  • Tasks:

    • mise run e2e runs the suite against OPENSHELL_GATEWAY.
    • mise run test ignores tests/e2e.
  • Gateway scripts (scripts/e2e/start-gateway.sh, stop-gateway.sh): copied from sdk-go's hack/automation/ with these changes:

    • start-gateway.sh adds --default-image, which sets the gateway's default sandbox image to the E2E image.
    • stop-gateway.sh removes sandbox containers by core's openshell.ai/managed-by and openshell.ai/sandbox-namespace labels. sdk-go filters on openshell.sandbox_namespace, which core doesn't set, so it misses them.
    • stop-gateway.sh exits nonzero with diagnostics when a cleanup step fails, instead of always reporting success.

    ci: shared CI checks across the SDK repositories #11 tracks sharing them and one script layout across the SDK repositories.

  • Workflows:

    • e2e.yml is reusable and can also be started by hand, as in sdk-go. Its core-version input defaults to OPENSHELL_CORE_REF.
    • ci.yml runs it on every PR and push to main. Unlike sdk-go, there's no path filter: almost every PR here touches the SDK, its pins or its tests, so we can add one later if E2E turns out slow or flaky. As in sdk-go, it isn't part of the required ci check.
  • README: explains how to run the suite locally.

Not in this PR:

Testing

  • mise run e2e against start-gateway.sh v0.1.7 --default-image openshell/e2e-python:dev on a local Docker host: 20 passed.
  • stop-gateway.sh removed the gateway and the sandboxes it created.
  • stop-gateway.sh against a stubbed docker: exits 1 with a message when saving the log, listing or removing containers, or compose down fails, and 0 when all succeed.
  • Without OPENSHELL_GATEWAY, pytest tests/e2e skips all 20.
  • mise run test (240 passed, E2E not collected) and mise run check pass.
  • actionlint and zizmor on the workflows. zizmor's only finding is the low-severity self-repository note, which sdk-go's ci.yml also has.
  • e2e.yml on GitHub: 20 passed against v0.1.7 in this PR's CI run.

@SDAChess SDAChess left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two teardown issues need fixing. The existing GitHub E2E run passed all 20 tests; review validation also covered shell syntax, E2E lint, imported-file parity, unit-test collection, skip behavior, and stubbed Docker failure paths. Live E2E was unavailable locally because Docker socket access was denied.

Comment thread scripts/e2e/stop-gateway.sh Resolved
Comment thread scripts/e2e/stop-gateway.sh Resolved
@pimlock
pimlock force-pushed the feat/6-e2e/pimlock branch from cc8a463 to 4546adc Compare November 9, 2026 15:33
@pimlock

pimlock commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@SDAChess Thanks! FYI these scripts were copied from the sdk-go for now. I also started tracking these shared pieces in #11

I will fix your comments here, but the same fix should be applied to sdk-go (I will do that), until we can share these.

@pimlock
pimlock requested a review from SDAChess November 9, 2026 15:36
SDAChess
SDAChess previously approved these changes Nov 9, 2026
Base automatically changed from feat/standalone-build/pimlock to main November 9, 2026 15:51
Ports the four core e2e/python files whose subject is the SDK, from
v0.1.7: sandbox_api, workspace_api, sandbox_exec_python and
exec_admission. They keep their calls to client._stub, because users
depend on it too. The conftest keeps only the fixtures these tests use
and skips every test when OPENSHELL_GATEWAY isn't set.

tests/e2e/Dockerfile.workload is a copy of core's sandbox image with the
client's Python and cloudpickle, which exec_python needs. mise run
e2e:image builds it, and conformance:check now also fails when it drifts
from core at the pin. mise run test ignores tests/e2e; mise run e2e runs
it against the gateway named in OPENSHELL_GATEWAY.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
e2e.yml and scripts/e2e/{start,stop}-gateway.sh come from sdk-go, so
both SDKs test against the same published gateway setup. The core
version defaults to OPENSHELL_CORE_REF, so a core bump PR tests its own
pin. start-gateway.sh adds --default-image, which points the gateway's
default sandbox image at the E2E image.

ci.yml runs E2E on every PR and push to main. The README and
CONTRIBUTING.md explain how to run it locally.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
stop-gateway.sh filtered on openshell.sandbox_namespace, which core's
Docker driver doesn't set, so sandbox and supervisor containers from
failed runs were left behind. Filter on openshell.ai/managed-by and
openshell.ai/sandbox-namespace instead.

It also ignored Docker failures and always reported success. Run every
cleanup step, print what failed, and exit nonzero if any step failed.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock
pimlock dismissed SDAChess’s stale review November 9, 2026 15:51

The merge-base changed after approval.

@pimlock
pimlock force-pushed the feat/6-e2e/pimlock branch from bd90c34 to 28a4805 Compare November 9, 2026 15:51
@pimlock
pimlock requested review from a team as code owners November 9, 2026 15:51
@pimlock
pimlock enabled stacked auto-merge (squash) November 9, 2026 15:52
@pimlock
pimlock merged commit b929d77 into main Nov 9, 2026
11 checks passed
@pimlock
pimlock deleted the feat/6-e2e/pimlock branch November 9, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: run an E2E suite against the published gateway of the pinned core version

2 participants