Skip to content

feat(e2e): add basic e2e test suite for runtime templates - #2339

Merged
jariy17 merged 23 commits into
aws:refactorfrom
Hweinstock:fix/e2e-integration-suite
Sep 21, 2026
Merged

jariy17 merged 23 commits into
aws:refactorfrom
Hweinstock:fix/e2e-integration-suite

Conversation

@Hweinstock

Copy link
Copy Markdown
Contributor

Problem

We are missing integration tests.

Solution

  • add tests that trigger on push events only (we can add scoped down version to PRs soon).
  • tests leverage vitest (not bun build in) because it gives some nice features like tagging. (which we can leverage for canary).
  • port over stack clean up logic.

Some patterns this PR attempts to establish:

  • tests should read as a sequence of CLI commands.
  • configuration should be separated from the the execution, such that making configuration changes is as easy as possible.
  • parametrize tests when possible to make it easy to re-use logic for different variants.
  • tests should be concurrent when possible, otherwise explicitly serial.

Verification

  • Running e2e locally using instructions (note I had to patch my CDK due to breaking changes).
  • there are two other bugs/gaps for follow-up: dev race condition and local invoke support for other protocols.

@github-actions github-actions Bot added the size/l PR size: L label Sep 18, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 18, 2026

@agentcore-devx-automation agentcore-devx-automation 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.

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.ts runs cleanupStaleStacks at 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 duplicate DeleteStack calls for the same stacks. Not a correctness issue.
  • CliRunner uses shell: true with concatenated arguments and a platform-specific quoteShellArg. Since input comes only from tests and AGENTCORE_CLI_PATH, this is fine, but it's worth remembering that the AGENTCORE_CLI_PATH value 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 a remove all and a deploy. Cosmetic.
  • "deploys all runtimes" asserts deployment.message contains "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.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 18, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@Hweinstock
Hweinstock force-pushed the fix/e2e-integration-suite branch from baec51c to 9be3605 Compare September 18, 2026 21:39
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Sep 18, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@codecov-commenter

codecov-commenter commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.26%. Comparing base (a23e472) to head (62c709a).
⚠️ Report is 1 commits behind head on refactor.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Sep 18, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 18, 2026
@Hweinstock
Hweinstock marked this pull request as ready for review September 18, 2026 22:05
Comment thread .github/workflows/ci.yml
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

e2e:
if: github.event_name == 'push'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we skip for now for simplicity, but eventually I think we should support a separate tag to run a reduced set.

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.

that is a good idea! when should that suite run and what would it contain?

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.

are you thinking of the idea of a tag that can "mark" certain suites as canary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

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.

2 and 3 would be killer!

@@ -0,0 +1,121 @@
name: e2e-test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

separating this out into its own workflow with workflow_call means the canary will be a thin wrapper.

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

LGTM, just small nits.

@@ -0,0 +1,386 @@
import { afterAll, beforeAll, describe, expect, test } from "vitest";

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.

should we name the test folder to e2e-tests? It would be clear for agents to only add e2e tests in here.

@Hweinstock Hweinstock Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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);

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.

Can you verify we got a 2xx response for A2A and http?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Sep 21, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@github-actions github-actions Bot added size/l PR size: L and removed size/l PR size: L labels Sep 21, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 21, 2026
@jariy17
jariy17 merged commit e72a6a4 into aws:refactor Sep 21, 2026
16 of 18 checks passed
@Hweinstock
Hweinstock deleted the fix/e2e-integration-suite branch September 21, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants