Skip to content

feat(plugin): add smart pre-commit test runner#950

Merged
JeremyDev87 merged 1 commit intomasterfrom
feat/smart-pre-commit-test-runner-944
Mar 26, 2026
Merged

feat(plugin): add smart pre-commit test runner#950
JeremyDev87 merged 1 commit intomasterfrom
feat/smart-pre-commit-test-runner-944

Conversation

@JeremyDev87
Copy link
Owner

Summary

  • Add SmartTestRunner class that maps changed files to related test files (TS → .spec/.test, Python → test_*.py, TSX → tests/)
  • Integrate into pre-tool-use.py hook to suggest related tests on git commit
  • Graceful degradation: subprocess failures or missing modules don't block commits
  • 18 new tests (12 unit + 6 integration), full suite 187/187 passing

Test plan

  • python3 -m pytest packages/claude-code-plugin/tests/test_smart_test_runner.py — 12 tests pass
  • python3 -m pytest packages/claude-code-plugin/tests/test_pre_tool_use.py — 16 tests pass (6 new)
  • Full suite: python3 -m pytest packages/claude-code-plugin/tests/ — 187/187 pass
  • CI checks: lint, format, typecheck, test:coverage, circular, build — all pass

Closes #944

…stions

- Add SmartTestRunner class with file-to-test mapping (TS, TSX, Python)
- Integrate into pre-tool-use hook to suggest related tests on git commit
- Support .spec/.test, __tests__/ directory, and test_*.py conventions
- Graceful degradation when subprocess or imports fail
- 18 tests (12 unit + 6 integration), all 187 suite tests passing

Closes #944
@vercel
Copy link

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Mar 26, 2026 6:44am

@JeremyDev87 JeremyDev87 self-assigned this Mar 26, 2026
@JeremyDev87 JeremyDev87 merged commit b5bd5ff into master Mar 26, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/smart-pre-commit-test-runner-944 branch March 26, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Smart pre-commit — run only related tests on git commit

1 participant