test(e2e): add end-to-end integration suite and e2e-tests workflow - #17
test(e2e): add end-to-end integration suite and e2e-tests workflow#17Hweinstock wants to merge 3 commits into
Conversation
858e2f3 to
a84e649
Compare
| @@ -0,0 +1,81 @@ | |||
| #!/usr/bin/env bun | |||
There was a problem hiding this comment.
I shouldn't need any of this. I should just run bun run test:e2e and it should work.
| @@ -0,0 +1,25 @@ | |||
| /** | |||
There was a problem hiding this comment.
follow existing pattern of camelCase. no need to nest this in hooks. Just move it to top with `
| process.env[AGENTCORE_E2E_ENV] = "1"; | ||
|
|
||
| try { | ||
| const deleted = await cleanupStaleStacks(); |
There was a problem hiding this comment.
we should instantiate the clients all here and inject them down.
| import { e2eProjectName, expectOk, ProjectWorkspace, retry } from "../support/project"; | ||
|
|
||
| /** | ||
| * Harness customer-flow coverage. Like the runtime suite, one project holds a |
There was a problem hiding this comment.
remove all these comments and make it way simpler. every single test should be parametrized.
| const DEPLOY_TIMEOUT_MS = 35 * 60 * 1000; | ||
| const INVOKE_TIMEOUT_MS = 15 * 60 * 1000; | ||
|
|
||
| describe.skipIf(!shouldRunE2e())("e2e: project harness lifecycle", () => { |
There was a problem hiding this comment.
don't do this. run all tests always.
| function resolveCli(): { command: string; prefix: string[] } { | ||
| const override = process.env.AGENTCORE_E2E_BIN; | ||
| if (override) return { command: override, prefix: [] }; | ||
| return { command: "node", prefix: [join(repoRoot, "dist", "index.js")] }; |
There was a problem hiding this comment.
all i want here is a simple run method that accepts cli command and runs it.
| */ | ||
| export const AGENTCORE_E2E_ENV = "AGENTCORE_E2E"; | ||
|
|
||
| /** True when the caller explicitly opted into the real-AWS e2e suite. */ |
| * runtimes can cold-start, so the first invoke may transiently fail; a couple of | ||
| * retries make the check robust without masking a real, persistent failure. | ||
| */ | ||
| export async function retry<T>(fn: () => Promise<T>, attempts = 3, delayMs = 15_000): Promise<T> { |
There was a problem hiding this comment.
rename support to helpers.
move rety to its own file it makes no sense in project.
| * commands run with the project directory as their working directory, matching | ||
| * how a developer drives the CLI from inside their project. | ||
| */ | ||
| export class ProjectWorkspace { |
| @@ -0,0 +1,74 @@ | |||
| # End-to-end integration tests | |||
There was a problem hiding this comment.
make this 1000% less concise
a84e649 to
230e286
Compare
Summary
Adds an end-to-end integration test suite for the
agentcoreCLI on therefactorbranch. Tests treat the CLI as a black box: they build it, run it as areal subprocess, and drive full customer journeys (create → add → deploy → invoke)
against a live AWS account, asserting only on exit codes and output.
Each feature file is one project that deploys many resources in a single stack,
and every test is a
test.eachrow over a plain table — adding coverage is addinga row, not writing a test.
test/project/runtime.test.ts— one project with a runtime for every template(
agent-python-minimal,agent-python-strands,-strands-container,agent-typescript-strands,agent-python-langchain,agent-typescript-vercel,mcp-python-fastmcp,a2a-python-strands,agui-python-strands). The first isscaffolded by
project create, the rest byproject add runtime. HTTP agents areinvoked; MCP/A2A/AGUI/TypeScript runtimes are verified from the deploy output.
test/project/memory.test.ts— one project comparing a no-memory template with amemory-backed one; the memory-backed runtime must recall a fact from an earlier
same-session turn.
test/project/harness.test.ts— one project with several harness configurations,each invoked.
test/helpers/—run.ts(spawn the built CLI, return stdout/stderr/exit),project.ts(temp-dir project + teardown),retry.ts.test/preRunCleanup.ts— atest:e2epreload that instantiates a CloudFormationclient and sweeps stale
AgentCore-e2estacks.Workflow (
e2e-test.yml)Given a git ref and a filepath pattern, it builds the CLI at that ref and runs the
matching e2e tests. Triggers on pushes to
refactor, is manually dispatchableagainst any ref/PR with a custom
test_path, and is reusable viaworkflow_call.Reuses the shared
agentcore-devx-devtoolscheck-collaboratoraction to gate runsto authorized collaborators, disables telemetry, and assumes an AWS role via OIDC
from the repo variable
E2E_ROLE_ARN.Running
Verification (local, dev account, us-east-1)
14 passed / 0 failed. Runtime file 9/9 (~13 min); harness (3) + memory (2) green
in the full-suite run. All projects torn down; no stacks left behind.
Representative timings (deploy dominates; invokes are seconds): the 9-runtime deploy
runs several minutes;
project invoke runtime2–13 s,project invoke harness3–49 s,
project create7–60 s,project add runtime~1 s.Notes
mcp/langchain,which make
uvsee the project depending on itself) and stay short somemory-strategy names stay within AgentCore's 48-char limit.
agent-typescript-strands,-vercel) are verified from thedeploy output rather than invoked (their data plane rejects the default invoke
content negotiation with a 406). Tracked as a follow-up.
E2E_ROLE_ARNbefore the workflow canauthenticate against the dev account.