Skip to content

test(e2e): run an E2E suite against the published gateway in CI - #15

Merged
pimlock merged 2 commits into
mainfrom
test/e2e-lane/pimlock
Nov 19, 2026
Merged

pimlock merged 2 commits into
mainfrom
test/e2e-lane/pimlock

Conversation

@pimlock

@pimlock pimlock commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an E2E lane modeled on sdk-python's. It runs a vitest suite against the published gateway of the pinned core version (Docker compute driver) on every CI run. Running it surfaced a bug: forward() failed every connection against a real gateway. This PR fixes that too.

Related Issue

None. This is the E2E lane sdk-python already has, plus the bug it found.

Changes

  • fix(forward): TcpForwardInit has a plain workspace field and no workspace_scope. forward() didn't set workspace, so the gateway rejected every connection with "workspace name is required" and the local socket closed with no data. The init now sends the workspace name (default when omitted). The forward unit test asserts it. No public API change.

  • Suite in e2e/sandbox.e2e.test.ts, which covers:

    • gateway health
    • sandbox lifecycle: create, waitReady, get, listAll, delete, waitDeleted, then not_found
    • label selectors and paging
    • exec with stdin, environment and working directory
    • execStream, with the exit event last
    • execInteractive: output drained after input EOF, and a tty only when requested
    • forward to a loopback HTTP server inside the sandbox
    • setSetting/getConfig
    • watchLogs

    It replaces e2e/interactive-exec.mjs, which nothing ran. Every test is skipped without OPENSHELL_GATEWAY.

  • Wiring: vitest.e2e.config.ts and a mise run e2e task. tsconfig.json now type-checks e2e/ and the config files.

  • Gateway scripts: scripts/e2e/start-gateway.sh and stop-gateway.sh, copied unchanged from sdk-python.

  • Workflow: .github/workflows/e2e.yml, which can also be dispatched with any core version. ci.yml calls it but doesn't require it for the ci check, as in sdk-python, because a fresh core tag can be pinned before its gateway image is published.

  • Docs: CONTRIBUTING.md and scripts/README.md.

Testing

  • mise run ci passes (206 unit tests)
  • Unit tests added/updated (if applicable)
  • E2E tests added/updated (if applicable)

Locally, the suite passed twice (10/10) against the published v0.1.9 gateway, started from core's compose files with a private sandbox namespace. Before the fix, the forward test failed with "workspace name is required". mise run workflows:check passes.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • README or CONTRIBUTING.md updated (if applicable)

TcpForwardInit names the workspace in a plain `workspace` field and has no
`workspace_scope`. forward() spread the sandbox target helper into the init,
so the gateway got no workspace and rejected every connection with
"workspace name is required"; the local socket closed with no data. The
unit tests use a fake gateway and didn't catch it. Send the workspace name,
`default` when omitted, and assert it in the forward unit test.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Port the sdk-python E2E lane: scripts/e2e/start-gateway.sh and
stop-gateway.sh (copied unchanged) start the published gateway of a core
version from core's deploy/docker files and register it as `e2e`, and
e2e.yml runs `mise run e2e` against it. ci.yml calls it on every run
without making it required, since a fresh core tag can be pinned before
its gateway image is published; it can also be dispatched with any core
version.

The vitest suite in e2e/ covers health, the sandbox lifecycle, label
selectors and paging, exec, execStream, execInteractive (output drained
after input EOF, tty allocation), forward, setSetting/getConfig, and
watchLogs. It replaces e2e/interactive-exec.mjs, which nothing ran, and is
skipped without OPENSHELL_GATEWAY.

Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
@pimlock
pimlock requested review from a team as code owners November 19, 2026 19:20
@pimlock
pimlock merged commit f5a079d into main Nov 19, 2026
11 checks passed
@pimlock
pimlock deleted the test/e2e-lane/pimlock branch November 19, 2026 20:12
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.

2 participants