diff-test gate: a diffed test file runs itself #497

Closed
opened 2026-08-24 12:54:42 +00:00 by jared · 3 comments
Owner

Context

#491 (merged 400cdfd) shipped DiffedTestPaths mapping only code-path files (lib -> test). A diffed test file is dropped, so a test-only change yields diff-test nil and relies on the suite gate. #491's task list explicitly named 'a diffed test file runs itself'.

Task

Include diffed files under project.test_path in DiffedTestPaths#paths as-is. Cover with a test.

Origin

  • Trigger: #491 close review 2026-08-24.
  • Chain: test-only diffs skip diff-test <- DiffedTestPaths selects only code-path files <- #491 task left unimplemented.
  • Skeptic verdict: CREATE (unimplemented stated requirement).
## Context #491 (merged 400cdfd) shipped DiffedTestPaths mapping only code-path files (lib -> test). A diffed test file is dropped, so a test-only change yields diff-test nil and relies on the suite gate. #491's task list explicitly named 'a diffed test file runs itself'. ## Task Include diffed files under project.test_path in DiffedTestPaths#paths as-is. Cover with a test. ## Origin - Trigger: #491 close review 2026-08-24. - Chain: test-only diffs skip diff-test <- DiffedTestPaths selects only code-path files <- #491 task left unimplemented. - Skeptic verdict: CREATE (unimplemented stated requirement).
Author
Owner

Insight from the 2026-08-24 #500 session (codebase freshly in context): implementation is where the ticket says, and small — DiffedTestPaths currently maps only code-path files (lib -> test) and drops files already under project.test_path; passing those through as-is is the whole change. Two things that make it easier now: (1) tests/support/ticket_fixture.rb (new in #500, commit b25598e) seeds a fully offline repo: tracker so any pipeline-level test around gates runs network-free; (2) note the diff-test gate consumer is GateCommands#to_h with nil-on-empty-diff semantics — preserve nil when the diff contains ONLY non-test, non-code files, or the gate's skip behavior changes. Related: if #499 resolves as 'lint test files in the test-writer gate', a test-only diff will exercise both changes — worth landing #497 first so #499 has the diff-test behavior to build on.

Insight from the 2026-08-24 #500 session (codebase freshly in context): implementation is where the ticket says, and small — DiffedTestPaths currently maps only code-path files (lib -> test) and drops files already under project.test_path; passing those through as-is is the whole change. Two things that make it easier now: (1) tests/support/ticket_fixture.rb (new in #500, commit b25598e) seeds a fully offline repo: tracker so any pipeline-level test around gates runs network-free; (2) note the diff-test gate consumer is GateCommands#to_h with nil-on-empty-diff semantics — preserve nil when the diff contains ONLY non-test, non-code files, or the gate's skip behavior changes. Related: if #499 resolves as 'lint test files in the test-writer gate', a test-only diff will exercise both changes — worth landing #497 first so #499 has the diff-test behavior to build on.
Author
Owner

Work started 2026-08-24: implementing test-file passthrough in DiffedTestPaths, direct on main.

Work started 2026-08-24: implementing test-file passthrough in DiffedTestPaths, direct on main.
Author
Owner

Resolution

Done: DiffedTestPaths#paths now unions diffed files under project.test_path as-is with the mapped code->test paths, deduped; GateCommands nil-on-empty diff-test skip preserved

Evidence: Commit 746753c on main: diffed_test_paths.rb +8/-1, new tests/runner/diffed_test_paths_test.rb (3 cases: test-only, mixed-union, non-code-empty) + gate_commands_test.rb case; red-then-green shown; rubocop clean; full suite 1067 runs with only the 4 pre-existing ChangeInterpreterAgentTest baseline failures

Follow-ups: Test-fixture consolidation (near-identical *ProjectFixture classes in two test files) considered and dropped — premature until the pattern recurs. Otherwise none.

## Resolution **Done:** DiffedTestPaths#paths now unions diffed files under project.test_path as-is with the mapped code->test paths, deduped; GateCommands nil-on-empty diff-test skip preserved **Evidence:** Commit 746753c on main: diffed_test_paths.rb +8/-1, new tests/runner/diffed_test_paths_test.rb (3 cases: test-only, mixed-union, non-code-empty) + gate_commands_test.rb case; red-then-green shown; rubocop clean; full suite 1067 runs with only the 4 pre-existing ChangeInterpreterAgentTest baseline failures **Follow-ups:** Test-fixture consolidation (near-identical *ProjectFixture classes in two test files) considered and dropped — premature until the pattern recurs. Otherwise none.
jared closed this issue 2026-08-24 20:57:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#497
No description provided.