From 4affa09ceb71d53b3da989d5eb2511cda6ad5e58 Mon Sep 17 00:00:00 2001 From: notgitika Date: Wed, 17 Jun 2026 16:42:27 -0400 Subject: [PATCH] test(e2e): fix shard 4/5 stale paths and missing --wait 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//.json'. The jobs engine refactor (#221) moved record storage under '.cli/jobs//.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. --- e2e-tests/archive-lifecycle.test.ts | 22 ++++++++++++++++++---- e2e-tests/config-bundle-eval-rec.test.ts | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/e2e-tests/archive-lifecycle.test.ts b/e2e-tests/archive-lifecycle.test.ts index 83b949a97..8dd74d167 100644 --- a/e2e-tests/archive-lifecycle.test.ts +++ b/e2e-tests/archive-lifecycle.test.ts @@ -151,7 +151,14 @@ describe.sequential('e2e: archive command lifecycle', () => { 'local .cli/batch-eval-results contains the run record', () => { expect(batchEvaluationId, 'batchEvaluationId should have been captured').toBeTruthy(); - const filePath = join(projectPath, 'agentcore', '.cli', 'batch-eval-results', `${batchEvaluationId}.json`); + const filePath = join( + projectPath, + 'agentcore', + '.cli', + 'jobs', + 'batch-eval-results', + `${batchEvaluationId}.json` + ); expect(existsSync(filePath), `Expected local record at ${filePath}`).toBe(true); }, 30000 @@ -196,7 +203,7 @@ describe.sequential('e2e: archive command lifecycle', () => { 'local .cli/recommendations contains the run record', () => { expect(recommendationId, 'recommendationId should have been captured').toBeTruthy(); - const filePath = join(projectPath, 'agentcore', '.cli', 'recommendations', `${recommendationId}.json`); + const filePath = join(projectPath, 'agentcore', '.cli', 'jobs', 'recommendations', `${recommendationId}.json`); expect(existsSync(filePath), `Expected local record at ${filePath}`).toBe(true); }, 30000 @@ -233,7 +240,14 @@ describe.sequential('e2e: archive command lifecycle', () => { it.skipIf(!canRun)( 'local .cli/batch-eval-results no longer contains the archived record', () => { - const filePath = join(projectPath, 'agentcore', '.cli', 'batch-eval-results', `${batchEvaluationId}.json`); + const filePath = join( + projectPath, + 'agentcore', + '.cli', + 'jobs', + 'batch-eval-results', + `${batchEvaluationId}.json` + ); expect(existsSync(filePath), `Local record should have been deleted from ${filePath}`).toBe(false); }, 30000 @@ -297,7 +311,7 @@ describe.sequential('e2e: archive command lifecycle', () => { it.skipIf(!canRun)( 'local .cli/recommendations no longer contains the archived record', () => { - const filePath = join(projectPath, 'agentcore', '.cli', 'recommendations', `${recommendationId}.json`); + const filePath = join(projectPath, 'agentcore', '.cli', 'jobs', 'recommendations', `${recommendationId}.json`); expect(existsSync(filePath), `Local record should have been deleted from ${filePath}`).toBe(false); }, 30000 diff --git a/e2e-tests/config-bundle-eval-rec.test.ts b/e2e-tests/config-bundle-eval-rec.test.ts index 88c505dba..ea8e69899 100644 --- a/e2e-tests/config-bundle-eval-rec.test.ts +++ b/e2e-tests/config-bundle-eval-rec.test.ts @@ -491,6 +491,7 @@ describe.sequential('e2e: config bundles, batch evaluation, and recommendations' 'You are a helpful assistant for testing.', '--lookback', '1', + '--wait', '--json', ]);