Skip to content

fix(test): include test/e2e in test globs and build before tests - #90

Draft
robotlearning123 wants to merge 1 commit into
mainfrom
loop/20260928_032029-issue80
Draft

robotlearning123 wants to merge 1 commit into
mainfrom
loop/20260928_032029-issue80

Conversation

@robotlearning123

Copy link
Copy Markdown
Member

Fixes #80.

WHAT

  • package.json test script: add test/e2e/*.test.ts to both test globs so the 9 orphaned e2e tests in test/e2e/cli.e2e.test.ts actually run (57 -> 66 tests).
  • Both test and test:coverage now run npm run build first: cli.e2e.test.ts spawns dist/index.js, which did not exist under CI-only test invocation (unbuilt: 2 pass / 7 fail; built: 9 pass / 0 fail).

WHY

  • Issue test/e2e/ never runs: package.json glob misses the subdirectory (9 orphaned tests) #80: package.json:32 glob 'test/*.test.ts' expands to only 4 top-level files; test/e2e/ never executes. Reproduced at origin/main e704b49.
  • Two explicit globs (test/.test.ts test/e2e/.test.ts, plain sh expansion) instead of a quoted 'test/**/*.test.ts': the recursive form over-collects 2 fixture sample files (test/fixtures/l3-repo/src/index.test.ts, test/fixtures/standard-repo/src/index.test.ts -> 68 tests, 2 of which fail without their fixture setup).

TEST EVIDENCE (all run in a fresh worktree at e704b49, npm ci exit 0)

  • RED premise: sh -c 'echo test/.test.ts' -> 4 files, no test/e2e/; npx tsx --test test/.test.ts -> # tests 57 / # pass 57 / # fail 0
  • GREEN: rm -rf dist && npm test -> exit 0, # tests 66 / # pass 66 / # fail 0
  • Issue acceptance oracle: npm test 2>&1 | grep -qE '^# (pass|tests) 6[6-9]' -> ORACLE-PASS (exit 0)
  • npm run test:coverage -> # tests 66 / # pass 66 / # fail 0
  • npx tsx --test test/e2e/cli.e2e.test.ts -> # tests 9 / # pass 9 / # fail 0 (orphans were not stale; no skips, no deletions)
  • git diff --stat: package.json | 4 ++-- only; zero overlap with PR fix(logger): route pino records to stderr so check --json stdout parses #89 files (src/utils/logger.ts, test/check-json.test.ts)

SCOPE

  • Exactly 2 script lines in package.json. No CI, dependency, or doc changes. No e2e test deleted or skipped.

@robotlearning123

Copy link
Copy Markdown
Member Author

STATUS: needs_work — independent review pending (grok-402 protocol).

Builder: devin (GOAL_COMPLETE, commit b7830b3). Verified by execution in fresh worktree at e704b49, npm ci exit 0:

  • RED premise: sh -c 'echo test/.test.ts' -> 4 files, no test/e2e/; npx tsx --test test/.test.ts -> # tests 57 / # pass 57 / # fail 0
  • GREEN: rm -rf dist && npm test -> exit 0, # tests 66 / # pass 66 / # fail 0
  • Issue acceptance oracle: npm test 2>&1 | grep -qE '^# (pass|tests) 6[6-9]' -> ORACLE-PASS (exit 0)
  • npm run test:coverage -> # tests 66 / # pass 66 / # fail 0
  • npx tsx --test test/e2e/cli.e2e.test.ts -> # tests 9 / # pass 9 / # fail 0 (orphaned tests are not stale; none deleted or skipped)
  • git diff --stat origin/main..HEAD -> package.json | 4 ++-- (only file; zero overlap with PR fix(logger): route pino records to stderr so check --json stdout parses #89 files src/utils/logger.ts, test/check-json.test.ts)
  • Commit message Conventional-Commits, no AI-attribution text (grep clean).

Review lane status (fleet-quota-gate, observed 2026-09-28T07:40:27Z): grok blocked until 2026-09-28T11:23:05Z; all review-role alternates also blocked (agy 2026-10-01T15:25Z, gpt6pro 17:00:09Z, opencode 17:23:20Z). Per the grok-402 protocol this PR stays draft until an independent cross-family review runs. NOT merge_ready.

One-command resume (run after 2026-09-28T11:23:05Z once fleet-quota-gate grok returns ok:true):

cd /tmp/loop-wt-agent-next_agent-ready-issue80 && grok -p 'Independent review of PR #90, head origin/loop/20260928_032029-issue80 (b7830b3), base main (e704b49). Diff is package.json only: test and test:coverage scripts gain npm run build && prefix plus test/e2e/*.test.ts glob. Run npm test (expect # tests 66 / # pass 66 / # fail 0) and the issue oracle npm test 2>&1 | grep -qE "^# (pass|tests) 6[6-9]". Check scope creep, attribution footers, and overlap with PR #89. Post verdict as a PR comment via gh pr comment 90 -R agent-next/agent-ready. Review-only: never merge, never approve, never push.' --always-approve --output-format plain

@robotlearning123

Copy link
Copy Markdown
Member Author

Independent review gate status: REVIEWER-LANE-UNAVAILABLE (grok 402), needs_work on the gate.

grok lane blocked: 2 live probes 2026-09-28 both failed with API error (status 402 Payment Required): Grok Build usage balance exhausted. Per the no-silent-skip rule the independent review is NOT complete; verdict stays REQUEST_CHANGES until grok runs.

Execution verification done in /tmp/loop-wt-agent-next_agent-ready-issue80 @ b7830b3 (node v22.22.0, npm 10.9.4):

  • diff origin/main...loop/20260928_032029-issue80: package.json only, +2/-2 (adds test/e2e/*.test.ts + npm run build && to test and test:coverage)
  • baseline without e2e: npx tsx --test test/*.test.ts -> # pass 57
  • full new suite: npm test -> # tests 66, # pass 66, # fail 0, # skipped 0 (all 9 previously-orphaned e2e tests pass once included; none stale)
  • issue test/e2e/ never runs: package.json glob misses the subdirectory (9 orphaned tests) #80 acceptance oracle: npm test 2>&1 | grep -qE '^# (pass|tests) 6[6-9]' -> PASS (# tests 66, # pass 66)

Non-blocking note: test:watch (package.json:34) still uses the old single-dir glob without e2e; watch mode is dev-only and out of this issue's minimal scope.

One-command resume runbook (after grok top-up):
timeout 540 grok --always-approve --cwd /tmp/loop-wt-agent-next_agent-ready-issue80 -p "REVIEW the diff origin/main...loop/20260928_032029-issue80 on agent-next/agent-ready for correctness, test coverage, and scope creep. Read the actual diff (git diff). REPRODUCE blocking findings with commands. Output exactly: VERDICT: SHIP or VERDICT: FIX-FIRST, then findings[] with file:line + failure scenario + severity, then checked_does_not_hold[]. Default to FIX-FIRST when uncertain."

If the worktree was already cleaned up, recreate first: git -C /home/robot/workspace/agent-next/agent-ready worktree add /tmp/loop-wt-agent-next_agent-ready-issue80 loop/20260928_032029-issue80

@robotlearning123

Copy link
Copy Markdown
Member Author

Verification (cycle 20260928_032029, issue #80): premise reproduced on main — package.json:32 glob expands to only 4 top-level files; npm test 57/57/0 while test/e2e/cli.e2e.test.ts holds 9 it() blocks that never ran. Fix at head b7830b3 (package.json, 2 script lines): npm run build && + two explicit globs (test/.test.ts test/e2e/.test.ts). Two honest refinements over the issue's literal proposal: (1) the e2e file spawns dist/index.js and CI never builds — without build it is 2 pass/7 fail, so the test script builds first; the 9 orphans are NOT stale (9/9/0 after build — none deleted or skipped); (2) the issue's quoted 'test/**/*.test.ts' over-collects 2 fixture sample files (68 tests) — explicit globs give exactly 66, satisfying the issue's acceptance oracle. Session re-verified by execution in a fresh worktree from clean dist: npm test 66/66/0, oracle grep ORACLE-PASS, coverage run 66/66 (84.65% lines, build rounds). Zero overlap with sibling PR #89 files. Independent review did NOT run (reviewer lane quota-blocked, retryAt 2026-09-29T05:10:50Z) — status: needs_work, review-gate only; zero code findings.

One-command resume when the reviewer lane recovers:
git -C /home/robot/workspace/agent-next/agent-ready fetch origin --prune && git -C /home/robot/workspace/agent-next/agent-ready worktree add /tmp/loop-wt-agent-next_agent-ready-issue80 loop/20260928_032029-issue80 2>/dev/null; timeout 540 grok --always-approve --cwd /tmp/loop-wt-agent-next_agent-ready-issue80 -p "REVIEW origin/main...loop/20260928_032029-issue80 on agent-next/agent-ready for correctness, test coverage, and scope creep. Read the actual diff (git diff). Judge against issue #80. Output exactly: VERDICT: SHIP or VERDICT: FIX-FIRST, then findings[] each with file:line + concrete failure scenario + severity, then checked_does_not_hold[]."

@robotlearning123

Copy link
Copy Markdown
Member Author

Reviewer lane recovered — grok review result: VERDICT SHIP.

findings[]: none. checked_does_not_hold (execution-verified):

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.

test/e2e/ never runs: package.json glob misses the subdirectory (9 orphaned tests)

1 participant