Skip to content

test(e2e): add end-to-end integration suite and e2e-tests workflow - #17

Draft
Hweinstock wants to merge 3 commits into
refactorfrom
feat/e2e-integration-tests
Draft

test(e2e): add end-to-end integration suite and e2e-tests workflow#17
Hweinstock wants to merge 3 commits into
refactorfrom
feat/e2e-integration-tests

Conversation

@Hweinstock

@Hweinstock Hweinstock commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Adds an end-to-end integration test suite for the agentcore CLI on the
refactor branch. Tests treat the CLI as a black box: they build it, run it as a
real 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.each row over a plain table — adding coverage is adding
a 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 is
    scaffolded by project create, the rest by project add runtime. HTTP agents are
    invoked; MCP/A2A/AGUI/TypeScript runtimes are verified from the deploy output.
  • test/project/memory.test.ts — one project comparing a no-memory template with a
    memory-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 — a test:e2e preload that instantiates a CloudFormation
    client and sweeps stale AgentCore-e2e stacks.

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 dispatchable
against any ref/PR with a custom test_path, and is reusable via workflow_call.
Reuses the shared agentcore-devx-devtools check-collaborator action to gate runs
to authorized collaborators, disables telemetry, and assumes an AWS role via OIDC
from the repo variable E2E_ROLE_ARN.

Running

ada credentials update --account <dev-account> --role Admin --once
export AWS_REGION=us-east-1
bun run test:e2e                                            # whole suite
E2E_TEST_PATH=test/project/runtime.test.ts bun run test:e2e # a subset

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 runtime 2–13 s, project invoke harness
3–49 s, project create 7–60 s, project add runtime ~1 s.

Notes

  • Runtime names avoid a template's own dependency name (e.g. not mcp/langchain,
    which make uv see the project depending on itself) and stay short so
    memory-strategy names stay within AgentCore's 48-char limit.
  • TypeScript runtimes (agent-typescript-strands, -vercel) are verified from the
    deploy output rather than invoked (their data plane rejects the default invoke
    content negotiation with a 406). Tracked as a follow-up.
  • CI on the fork needs the repo variable E2E_ROLE_ARN before the workflow can
    authenticate against the dev account.

@Hweinstock
Hweinstock force-pushed the feat/e2e-integration-tests branch 2 times, most recently from 858e2f3 to a84e649 Compare September 4, 2026 04:35
Comment thread script/run-e2e-local.ts Outdated
@@ -0,0 +1,81 @@
#!/usr/bin/env bun

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I shouldn't need any of this. I should just run bun run test:e2e and it should work.

Comment thread test/hooks/pre-run-cleanup.ts Outdated
@@ -0,0 +1,25 @@
/**

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

follow existing pattern of camelCase. no need to nest this in hooks. Just move it to top with `

Comment thread test/hooks/pre-run-cleanup.ts Outdated
process.env[AGENTCORE_E2E_ENV] = "1";

try {
const deleted = await cleanupStaleStacks();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

we should instantiate the clients all here and inject them down.

Comment thread test/project/harness.test.ts Outdated
import { e2eProjectName, expectOk, ProjectWorkspace, retry } from "../support/project";

/**
* Harness customer-flow coverage. Like the runtime suite, one project holds a

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove all these comments and make it way simpler. every single test should be parametrized.

Comment thread test/project/harness.test.ts Outdated
const DEPLOY_TIMEOUT_MS = 35 * 60 * 1000;
const INVOKE_TIMEOUT_MS = 15 * 60 * 1000;

describe.skipIf(!shouldRunE2e())("e2e: project harness lifecycle", () => {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

don't do this. run all tests always.

Comment thread test/support/cli.ts Outdated
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")] };

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

all i want here is a simple run method that accepts cli command and runs it.

Comment thread test/support/env.ts Outdated
*/
export const AGENTCORE_E2E_ENV = "AGENTCORE_E2E";

/** True when the caller explicitly opted into the real-AWS e2e suite. */

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove all this

Comment thread test/support/project.ts Outdated
* 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> {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

rename support to helpers.

move rety to its own file it makes no sense in project.

Comment thread test/support/project.ts Outdated
* commands run with the project directory as their working directory, matching
* how a developer drives the CLI from inside their project.
*/
export class ProjectWorkspace {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove this

Comment thread test/README.md
@@ -0,0 +1,74 @@
# End-to-end integration tests

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

make this 1000% less concise

@Hweinstock
Hweinstock force-pushed the feat/e2e-integration-tests branch from a84e649 to 230e286 Compare September 4, 2026 22:14
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.

1 participant