fix(discovery): suffix + inheritance-based test class matching#87
fix(discovery): suffix + inheritance-based test class matching#87NikkeTryHard merged 5 commits intomasterfrom
Conversation
- Bump cargo jobs and test threads from 4 to 8 - Cap nextest threads at 8 for predictable runs - Switch Dockerfile sccache/nextest to pre-built binaries - Add cargo-target volume for persistent build cache
Add is_test_class() to match classes ending with Test, Tests, or TestCase
alongside the existing starts_with("Test") prefix check. Add
has_testcase_base() to inspect AST base classes for TestCase inheritance.
Update scanner to use both name matching and base class inspection.
Simplify resolver fixture lookup — remove redundant name filter since
scanner already validates classes at discovery time.
Closes #80
…covery Cover suffix-based class names (LoginTest, ModelFormTests), TestCase suffix (AutodiscoverModulesTestCase), async methods in suffix classes, unittest.TestCase base class detection, and comprehensive edge cases (Contest, Fastest, Tes, etc.).
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR increases build parallelism (jobs and test threads from 4 to 8), optimizes Docker builds by downloading pre-built binaries instead of building from source, refactors benchmark code to use standard library imports directly, adds persistent cargo volume in Docker Compose, and enhances Python test discovery to recognize test classes by multiple naming conventions (suffix-based matching) and base-class inheritance patterns. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Suggested labels
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
is_test_class()helper matchingTest*prefix,*Test,*Tests, and*TestCasesuffixeshas_testcase_base()to inspect AST base classes for directTestCaseinheritancecriterion::black_boxin bench filesCloses #80
Results
Verified in Docker:
cargo build✅cargo fmt✅cargo clippy -D warnings✅854/854 tests pass✅Follow-up
Remaining gaps (transitive inheritance, inherited methods) tracked in #86.
Summary by CodeRabbit
New Features
Performance Improvements