Skip to content

test(e2e): fix shard 4/5 stale paths and missing --wait#1560

Merged
Hweinstock merged 1 commit into
aws:mainfrom
notgitika:fix/e2e-shard-4-failures
Jun 17, 2026
Merged

test(e2e): fix shard 4/5 stale paths and missing --wait#1560
Hweinstock merged 1 commit into
aws:mainfrom
notgitika:fix/e2e-shard-4-failures

Conversation

@notgitika

@notgitika notgitika commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

there are 3 failures in e2e shard 4. they are based on stale assumptions.

2 of them have the same root cause: path migration to a common jobs/ dir. those tests are looking at the wrong place for the run results file.

the other one is expecting json.result to be defined but since that was made async recently, the user has to pass --wait, otherwise it works async.

this PR aims to fix all of those 3 tests.

note: no CLI code is being touched here, only text fixes

Three failures on the full-suite run for main, all stale assumptions
the production code already moved past:

- archive-lifecycle.test.ts: 'local .cli/batch-eval-results contains
  the run record' (line 154) and 'local .cli/recommendations contains
  the run record' (line 199) check filesystem paths under
  '.cli/<dir>/<id>.json'. The jobs engine refactor (aws#221) moved record
  storage under '.cli/jobs/<dir>/<id>.json' (see
  src/cli/operations/jobs/shared/storage.ts:28). Add the missing 'jobs'
  segment in all four occurrences (capture + post-archive deletion
  checks; the post-archive checks were silently passing-by-omission
  because they assert non-existence at a path that never existed).

- config-bundle-eval-rec.test.ts: 'runs system prompt recommendation
  with inline content via CLI' (line 478) is the only recommendation
  test that asserts on json.result. Without --wait the CLI returns
  immediately after StartRecommendation while the job is still
  PENDING/IN_PROGRESS; record.result is only populated by refresh()
  once status reaches COMPLETED. Add --wait to that test so it blocks
  to a terminal state before reading result.
@notgitika notgitika requested a review from a team June 17, 2026 20:43
@github-actions github-actions Bot added the size/s PR size: S label Jun 17, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.19.0.tgz

How to install

gh release download pr-1560-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.19.0.tgz

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 17, 2026
@notgitika

Copy link
Copy Markdown
Contributor Author

should close #1553 will verify post merge

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. Verified the fixes against the codebase:

Path migration (archive-lifecycle.test.ts): src/cli/operations/jobs/shared/storage.ts writes to <configRoot>/.cli/jobs/{STORAGE_DIRS[type]}/{id}.json, and STORAGE_DIRS in shared/constants.ts maps 'recommendation' → 'recommendations' and 'batch-evaluation' → 'batch-eval-results'. The four updated paths in the test match. Good catch on the two post-archive deletion checks at lines 240/311 — those were trivially passing before since they assert the file doesn't exist at the (wrong) path.

--wait for the inline-content recommendation test (config-bundle-eval-rec.test.ts:494): Confirmed record.result is only populated by refresh() (handler.ts:293) and --wait (command.tsx:620–627) routes through waitForTerminal which polls until isTerminal(record). Without --wait the synchronous post-StartRecommendation path returns before refresh ever runs, so result is necessarily undefined. The other three recommendation tests in the file don't read json.result, so leaving them without --wait is fine.

Test-only change; no telemetry or mocking concerns. No new issues.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 17, 2026

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

nice! (will merge in post-release)

@Hweinstock Hweinstock merged commit abccd4f into aws:main Jun 17, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants