Repository navigation
test: add Kind-based E2E test suite and CI workflow - #474
Conversation
There was a problem hiding this comment.
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.
f03b108 to
6879b18
Compare
|
/cc @mayawang |
|
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. |
MushuEE
left a comment
There was a problem hiding this comment.
Just left a few comments, glad CI/CD is going.
|
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. |
|
Thanks @mayawang! That makes total sense—keeping the E2E test suite PR self-contained is much cleaner. I have:
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
left a comment
There was a problem hiding this comment.
Confirmed with isolated reproductions against this head; each suggested change was checked locally.
|
Thanks @rich7420 for the thorough review and clear reproduction steps! All of your suggestions were very well reasoned and have been applied in
|
Signed-off-by: siyuanfoundation <[email protected]>
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
Signed-off-by: siyuanfoundation <[email protected]>
mayawang
left a comment
There was a problem hiding this comment.
Thanks @siyuanfoundation, clean now that the lock and bump changes landed on their own, and the e2e job passes. Approving.
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/e2e/): Go tests covering the Workspace/Model CRUD, the task lifecycle and its sync with Substrate Actors/ActorTemplates,suspend/resume persistence,
ax sshand the in-sandbox metadata server, multi-workspace + git setup, WatchTask, and atespace isolation. The tests are skipped bygo test ./...unless--e2e/AX_E2E=trueis set.hack/):setup-e2e-kind.shprovisions Kind + Substrate (atSUBSTRATE_REF, defaulting to the version in go.mod) + AX;run-e2e.sh,run- e2e-kind.shandcleanup-e2e-kind.shrun the tests and tear the cluster down.test-e2e,test-e2e-head(Substratemain),e2e-setup,e2e-run,e2e-cleanup..github/workflows/e2e.yml): PRs and pushes run against the Substrate version in go.mod, so unreleased Substrate changes never block PRs. A nightlyrun tests Substrate
mainto catch incompatibilities early. Manual runs accept any ref.Small production changes
AX_DEFAULT_TASK_IMAGEoverrides the default task image (used to point E2E at a locally built image), viasubstrate.DefaultTaskImage().Dockerfile.task-runnertakes aTARGETARCHbuild arg.ax suspend/ax resumeCLI 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 Substratemain. This is expected: substrate#2586 changedsandbox_classfrom enum to string. this e2e test is designed to catch that. A separate PR to bump the version will fix that.