Skip to content

test(#460): add batch-executor unit tests for label-based phase shortcuts - #464

Merged
admarble merged 4 commits into
mainfrom
feature/460-add-batch-executor-unit-tests-for-label-based-phas
Mar 26, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/460-add-batch-executor-unit-tests-for-label-based-phas

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Add batch-executor.test.ts with 18 unit tests covering label-based phase shortcuts and issueConfig construction
  • Tests verify the wiring between batch-executor's label detection and executePhaseWithRetry — the gap that phase-mapper tests alone cannot cover
  • Covers all 4 original ACs plus 2 derived ACs (case-insensitivity, autoDetectPhases=false)

Pre-PR AC Verification

AC Source Description Status Evidence
AC-1 Original batch-executor.test.ts exists with tests for isSimpleBugFix, isDocs ✅ 5 tests across both shortcut types
AC-2 Original issueConfig.issueType set to "docs" for docs labels ✅ 3 tests (docs, documentation, readme)
AC-3 Original No issueType for non-docs labels ✅ 3 tests (enhancement, bug, empty)
AC-4 Original Bug labels take precedence over docs in phase selection ✅ 2 tests (phases + issueType independence)
AC-5 Derived Case-insensitive label matching ✅ 3 tests (BUG, DOCS, Documentation)
AC-6 Derived autoDetectPhases=false skips shortcuts ✅ 2 tests

Test plan

  • npx vitest run src/lib/workflow/batch-executor.test.ts — 18/18 pass
  • npm run build — clean
  • npm run lint — clean

Closes #460

…cuts

Add batch-executor.test.ts with 18 tests covering:
- AC-1: Bug label shortcuts (bug, fix, hotfix) skip spec → [exec, qa]
- AC-1: Docs label shortcuts (docs, documentation) skip spec → [exec, qa]
- AC-2: issueConfig.issueType set to "docs" for docs labels
- AC-3: No issueType leak for non-docs labels (enhancement, bug, empty)
- AC-4: Bug labels take precedence over docs in phase selection,
  but issueConfig.issueType still set to "docs" independently
- AC-5 (derived): Case-insensitive label matching (BUG, DOCS, Documentation)
- AC-6 (derived): autoDetectPhases=false skips label shortcuts entirely

Closes #460
…se-positives

- Add missing 'patch' label test (last untested BUG_LABEL)
- Add 'readme' phase shortcut test (was only tested for issueType, not phases)
- Fix non-discriminating AC-6 test: use phases ["qa"] to distinguish
  explicit phases from bug shortcut output ["exec", "qa"]
- Add includes() substring false-positive tests documenting current
  behavior for #461 (dispatch→patch, redocs-system→doc)
After merging main (which includes #461), substring labels like
"dispatch" no longer match "patch". Update tests to verify that
exact matching correctly rejects substring false positives.
@admarble
admarble merged commit 18bb6b1 into main Mar 26, 2026
5 checks passed
@admarble
admarble deleted the feature/460-add-batch-executor-unit-tests-for-label-based-phas branch April 6, 2026 21:50
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.

Add batch-executor unit tests for label-based phase shortcuts

1 participant