feat(e2e): add basic e2e test suite for runtime templates - #2339
Conversation
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice PR. The test structure follows the "spawn the real CLI as a subprocess" pattern the guidelines call out, avoids mocking entirely, and reads as a sequence of CLI commands as advertised. A few minor observations, none blocking:
test/setup.tsrunscleanupStaleStacksat module top-level, so it will execute once per vitest worker. That's probably fine (stale-stack deletion is idempotent and stack age already excludes anything <2h old), but worth being aware of if workers ever run in parallel — you could end up issuing duplicateDeleteStackcalls for the same stacks. Not a correctness issue.CliRunnerusesshell: truewith concatenated arguments and a platform-specificquoteShellArg. Since input comes only from tests andAGENTCORE_CLI_PATH, this is fine, but it's worth remembering that theAGENTCORE_CLI_PATHvalue itself is not quoted — a workspace path with spaces on Windows would break the Windows job. Given CodeBuild's default checkout path this shouldn't happen today.- The last test is named
"deploys the empty project"but actually does both aremove alland a deploy. Cosmetic. "deploys all runtimes"assertsdeployment.messagecontains"Deployed project", which couples the test to the exact wording of a user-facing string. Consider asserting on a stable structural field if one exists, otherwise fine.
Telemetry isn't applicable here — this PR only adds test infrastructure.
|
Claude Security Review: no high-confidence findings. (run) |
baec51c to
9be3605
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2339 +/- ##
=========================================
Coverage 97.26% 97.26%
=========================================
Files 610 610
Lines 40590 40590
=========================================
Hits 39480 39480
Misses 1110 1110 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude Security Review: no high-confidence findings. (run) |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| e2e: | ||
| if: github.event_name == 'push' |
There was a problem hiding this comment.
we skip for now for simplicity, but eventually I think we should support a separate tag to run a reduced set.
There was a problem hiding this comment.
that is a good idea! when should that suite run and what would it contain?
There was a problem hiding this comment.
are you thinking of the idea of a tag that can "mark" certain suites as canary?
There was a problem hiding this comment.
are you thinking of the idea of a tag that can "mark" certain suites as canary?
yes exactly!
that is a good idea! when should that suite run and what would it contain?
I have some ideas here.
- One is that we should run the basic tests across functionality (effectively smoke test each feature)
- another is that we could maybe check the filepaths touched to guess some tags that should run.
- another is that a reviewer or harness reviewer could manually/automatically ask for certain tags to be run.
I'll likely start with the first one, and we can explore the others as we get more time. Overall, I want to keep the PR e2e tests short for faster feedback, and reserve all of them for the push event.
There was a problem hiding this comment.
2 and 3 would be killer!
| @@ -0,0 +1,121 @@ | |||
| name: e2e-test | |||
There was a problem hiding this comment.
separating this out into its own workflow with workflow_call means the canary will be a thin wrapper.
| @@ -0,0 +1,386 @@ | |||
| import { afterAll, beforeAll, describe, expect, test } from "vitest"; | |||
There was a problem hiding this comment.
should we name the test folder to e2e-tests? It would be clear for agents to only add e2e tests in here.
There was a problem hiding this comment.
sure, I can rename to e2eTest to match the camel case convention. I'm used to the test/ convention from other languages, but not sure if this is a pattern in TS.
| } | ||
|
|
||
| if (runtime.protocol === "A2A") { | ||
| const response = parseResult(A2aResponseSchema, result); |
There was a problem hiding this comment.
Can you verify we got a 2xx response for A2A and http?
There was a problem hiding this comment.
I don't think we get a direct status code on non-http protocol runtimes, but I can add a check that there is not an error in the response.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
Problem
We are missing integration tests.
Solution
Some patterns this PR attempts to establish:
Verification