Skip to content

feat(e2e): add harness tests - #2384

Open
Hweinstock wants to merge 2 commits into
aws:refactorfrom
Hweinstock:test/harness-e2e-happy-path
Open

Hweinstock wants to merge 2 commits into
aws:refactorfrom
Hweinstock:test/harness-e2e-happy-path

Conversation

@Hweinstock

Copy link
Copy Markdown
Contributor

Problem

Add e2e harness tests.

Solution

  • copy the runtime pattern of a few concise cases, and some general tests that add, deploy, invoke each harness.
  • add cases for different memory options, and a custom system prompt.

Verification

 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'managed_memory' can be added to a project 468ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'disabled_memory' can be added to a project 470ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'semantic_memory' can be added to a project 462ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'custom_prompt' can be added to a project 467ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > deploys all harnesses 225911ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'managed_memory' can be invoked after deployed 4437ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'custom_prompt' can be invoked after deployed 4571ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'disabled_memory' can be invoked after deployed 6168ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > 'semantic_memory' can be invoked after deployed 6370ms
 ✓ e2eTest/project/harness.test.ts > add, deploy, and invoke harnesses > removes all harnesses and deploys the empty project 379863ms

 Test Files  1 passed | 1 skipped (2)
      Tests  10 passed | 38 skipped (48)
   Start at  19:10:30
   Duration  619.15s (transform 94ms, setup 522ms, import 342ms, tests 618.61s, environment 0ms)

@github-actions github-actions Bot added the size/m PR size: M label Sep 22, 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 22, 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 22, 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, clean addition. The PR extracts TIMEOUT_MS into a shared e2eTest/timeouts.ts, adds a HARNESS tag, and introduces e2eTest/project/harness.test.ts covering add → deploy → invoke → remove for four harness variants (managed memory default, disabled memory, semantic memory, custom system prompt). It follows the existing templates.test.ts pattern closely.

Things I checked:

  • --memory, --system-prompt, and --prompt flags all exist on project add harness / project invoke harness.
  • Transcript filtering on kind === "text" correctly targets assistant text items (user/reasoning/notice are excluded), and the CUSTOM_PROMPT_RESPONSE sentinel doesn't collide with the "Respond now." prompt.
  • deploy --yes returning "Removed project ..." after remove all is consistent with deployedMessage in src/handlers/project/deploy/index.ts.
  • Using mkdtemp and real CLI invocations avoids the excessive-mocking pattern flagged in the review rubric.
  • Telemetry guidance doesn't apply here — this is test-only.

Minor observations (non-blocking, no changes required):

  • The first three test cases only assert responseText.trim() !== "", which is a weak liveness check. That's a reasonable tradeoff given LLM nondeterminism, and the custom_prompt case does provide a stronger check.
  • The invoke tests run with concurrent: true and don't pass --session-id, so each invocation gets a fresh server-generated session. That's fine since each test targets a different harness.

Looks good to merge.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 22, 2026
@Hweinstock
Hweinstock marked this pull request as ready for review September 22, 2026 19:36
@Hweinstock
Hweinstock force-pushed the test/harness-e2e-happy-path branch from f476872 to d214d7a Compare September 22, 2026 20:30
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 22, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 22, 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 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (484fdde) to head (d214d7a).
⚠️ Report is 4 commits behind head on refactor.

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2384   +/-   ##
=========================================
  Coverage     97.25%   97.25%           
=========================================
  Files           613      613           
  Lines         41028    41028           
=========================================
  Hits          39902    39902           
  Misses         1126     1126           

☔ 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants