Commit Graph

2 Commits

Author SHA1 Message Date
Rockachopa
d998477a88 refactor(test-gen): improve codebase test generator to produce passing tests with edge cases
Some checks failed
Self-Healing Smoke / self-healing-smoke (pull_request) Failing after 21s
Smoke Test / smoke (pull_request) Failing after 22s
Agent PR Gate / gate (pull_request) Failing after 33s
Agent PR Gate / report (pull_request) Successful in 8s
- Generate both main and edge case tests for each coverage gap
- Use MagicMock for complex unknown arguments to avoid crashes
- Fix async test generation (async def, await calls)
- Remove placeholder tautology assertions; tests now verify execution
- Fix args.max_tests bug

Generated tests now pass (0 failures) and include real edge coverage.

Closes #667
2026-04-29 01:39:00 -04:00
Timmy
3b273f1345 feat: Codebase Test Generator — Fill Coverage Gaps (#667)
Some checks failed
Smoke Test / smoke (pull_request) Failing after 23s
Add scripts/codebase_test_generator.py:
- AST analysis: finds all functions/methods in source files
- Coverage gap detection: identifies functions without tests
- Test generation: creates pytest test cases for each gap
- Priority: high (has return/raises), medium (public), low (private)
- Auto-generated markers for human review

Stats: 161 source files, 1219 functions, 873 coverage gaps found
Generated 50 tests: 14 pass, 30 skip (import), 6 fail (wrong args)

Usage:
  python scripts/codebase_test_generator.py --source . --output tests/test_genome_generated.py
2026-04-14 22:09:33 -04:00