Skip to content

test: add Kind-based E2E test suite and CI workflow - #474

Merged
siyuanfoundation merged 6 commits into
google:mainfrom
siyuanfoundation:e2e
Oct 21, 2026
Merged

siyuanfoundation merged 6 commits into
google:mainfrom
siyuanfoundation:e2e

Conversation

@siyuanfoundation

@siyuanfoundation siyuanfoundation commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an end-to-end test suite that runs AX against a real Substrate install in a local Kind cluster, plus a GitHub Actions workflow to run it.

What's included

  • Test suite (test/e2e/): Go tests covering the Workspace/Model CRUD, the task lifecycle and its sync with Substrate Actors/ActorTemplates,
    suspend/resume persistence, ax ssh and the in-sandbox metadata server, multi-workspace + git setup, WatchTask, and atespace isolation. The tests are skipped by
    go test ./... unless --e2e / AX_E2E=true is set.
  • Scripts (hack/): setup-e2e-kind.sh provisions Kind + Substrate (at SUBSTRATE_REF, defaulting to the version in go.mod) + AX; run-e2e.sh, run- e2e-kind.sh and cleanup-e2e-kind.sh run the tests and tear the cluster down.
  • Make targets: test-e2e, test-e2e-head (Substrate main), e2e-setup, e2e-run, e2e-cleanup.
  • CI (.github/workflows/e2e.yml): PRs and pushes run against the Substrate version in go.mod, so unreleased Substrate changes never block PRs. A nightly
    run tests Substrate main to catch incompatibilities early. Manual runs accept any ref.

Small production changes

  • AX_DEFAULT_TASK_IMAGE overrides the default task image (used to point E2E at a locally built image), via substrate.DefaultTaskImage().
  • Dockerfile.task-runner takes a TARGETARCH build arg.
  • The ax suspend / ax resume CLI timeout goes from 15s to 60s.

Testing

  • make test-e2e: 8/8 tests pass against Substrate at the go.mod version (f6a1dc72).
  • make test-e2e-head: the 5 task tests fail against Substrate main. This is expected: substrate#2586 changed sandbox_class from enum to string. this e2e test is designed to catch that. A separate PR to bump the version will fix that.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces an end-to-end (E2E) testing suite for AX, including scripts to provision a Kind cluster, deploy Substrate and AX, and run tests. It also adds a mechanism to override the default task image via the AX_DEFAULT_TASK_IMAGE environment variable and updates the task lifecycle to use a configurable timeout. My review identified several portability issues in the shell scripts, specifically regarding the use of non-portable xargs flags on macOS and potential issues with directory creation and symlink checks, which I have provided suggestions to resolve.

Comment thread hack/setup-e2e-kind.sh Resolved
Comment thread hack/setup-e2e-kind.sh Resolved
Comment thread hack/setup-e2e-kind.sh Resolved
Comment thread hack/run-e2e.sh Resolved
Comment thread hack/setup-e2e-kind.sh Resolved
@siyuanfoundation siyuanfoundation changed the title Add Kind-based E2E test suite and CI workflow fix: Bump substrate to 0.5.0 and add Kind-based E2E test suite and CI workflow Oct 15, 2026
@siyuanfoundation
siyuanfoundation marked this pull request as ready for review October 15, 2026 02:17
@siyuanfoundation
siyuanfoundation force-pushed the e2e branch 3 times, most recently from f03b108 to 6879b18 Compare October 15, 2026 15:15
@siyuanfoundation

Copy link
Copy Markdown
Collaborator Author

/cc @mayawang

@mayawang

Copy link
Copy Markdown
Collaborator

Thanks @siyuanfoundation, this is a great addition. I went through the workflow and the permissions, triggers and input handling all look right. One ask: could the Substrate v0.5.0 bump go in its own PR? Bumps are what people need to find later when something breaks (like #443 this week), so it's easier if they're separate from the e2e suite. Happy to review both.

@siyuanfoundation siyuanfoundation changed the title fix: Bump substrate to 0.5.0 and add Kind-based E2E test suite and CI workflow fix: add Kind-based E2E test suite and CI workflow Oct 15, 2026
Comment thread .github/workflows/e2e.yml Resolved
Comment thread cmd/ax/main.go Resolved
Comment thread internal/controller/reconciler.go Resolved

@MushuEE MushuEE left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just left a few comments, glad CI/CD is going.

@siyuanfoundation siyuanfoundation changed the title fix: add Kind-based E2E test suite and CI workflow feat: add Kind-based E2E test suite and CI workflow Oct 15, 2026
@siyuanfoundation siyuanfoundation changed the title feat: add Kind-based E2E test suite and CI workflow test: add Kind-based E2E test suite and CI workflow Oct 15, 2026
@mayawang

Copy link
Copy Markdown
Collaborator

Thanks @siyuanfoundation. Could the lock-lease renewal (9a69355) go in its own PR? #483 tackles the same problem from the other side (capping a request under the lock TTL), and the two need to agree: renewal plus longer CLI timeouts vs a 25s server-side cap. I'd lean to renewal as the base with #483's deadline as a looser safety net, but let's settle it on one PR rather than inside the e2e suite.

@siyuanfoundation

Copy link
Copy Markdown
Collaborator Author

Thanks @mayawang! That makes total sense—keeping the E2E test suite PR self-contained is much cleaner.

I have:

  1. Removed the lock-lease renewal commit (9a69355) from this branch and force-pushed.
  2. Opened a dedicated PR for the lock-lease renewal: lock,cli: renew Redis lock leases and lengthen suspend/resume timeout #490.

I agree with your suggestion to use lease renewal as the base (so long-running operations like snapshot/restore aren't artificially cut off) while having a looser server-side safety net as introduced in #483. Let's coordinate the integration over on #490 and #483.

@rich7420 rich7420 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.

Confirmed with isolated reproductions against this head; each suggested change was checked locally.

Comment thread test/e2e/e2e_test.go Resolved
Comment thread hack/cleanup-e2e-kind.sh Resolved
Comment thread hack/run-e2e-kind.sh Resolved
Comment thread hack/setup-e2e-kind.sh Resolved
Comment thread test/e2e/harness_test.go Resolved
Comment thread hack/run-e2e.sh Resolved
@siyuanfoundation

Copy link
Copy Markdown
Collaborator Author

Thanks @rich7420 for the thorough review and clear reproduction steps! All of your suggestions were very well reasoned and have been applied in fb82714:

  1. hack/cleanup-e2e-kind.sh: Preserved the caller's KIND_CLUSTER_NAME if already set when sourcing e2e.env.
  2. hack/run-e2e-kind.sh: Explicitly exported KIND_CLUSTER_NAME before setup so the exit trap won't fall back to a stale cluster name.
  3. hack/run-e2e.sh: Preserved explicit AX_BIN overrides across sourcing e2e.env.
  4. hack/setup-e2e-kind.sh: Refreshed and resolved the remote branch on origin for the managed Substrate clone so make test-e2e-head tracks upstream advances.
  5. test/e2e/harness_test.go: Passed --context explicitly in runAX to guard against ambient KUBECONTEXT overrides.
  6. test/e2e/e2e_test.go: Updated TestE2E_CLIVersionAndAutoTunnel to use tunnel stop and assert that the background tunnel is torn down.

siyuanfoundation and others added 6 commits October 20, 2026 21:03
The default task image is a property of the Task spec, not of the
Substrate client. Move the AX_DEFAULT_TASK_IMAGE override out of
internal/substrate and make it a NewTaskReconciler argument alongside the
default template, falling back to v1alpha1.DefaultTaskImage. ax-server
sets it from --default-task-image / $AX_DEFAULT_TASK_IMAGE.

Signed-off-by: siyuanfoundation <[email protected]>
Signed-off-by: siyuanfoundation <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…l test

- Preserve caller's KIND_CLUSTER_NAME when sourcing e2e.env during cleanup
- Export default KIND_CLUSTER_NAME before setup in run-e2e-kind.sh
- Preserve caller-provided AX_BIN when sourcing e2e.env in run-e2e.sh
- Fetch and resolve origin branch in managed clone for SUBSTRATE_REF
- Pass --context explicitly in test harness runAX helper
- Use 'tunnel stop' and verify tunnel shutdown in auto-tunnel test

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @siyuanfoundation, clean now that the lock and bump changes landed on their own, and the e2e job passes. Approving.

@siyuanfoundation
siyuanfoundation merged commit 43439b4 into google:main Oct 21, 2026
10 checks passed
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.

5 participants