feat: add Groovy/Spock test file pattern support#266
Open
rcasia wants to merge 4 commits into
Open
Conversation
- Update file_checker to strip .groovy extension alongside .java - Add GROOVY_TEST_FILE_PATTERNS to patterns module - Add tests for Groovy/Spock test file detection Closes #194
- Add maven-groovy fixture with Spock test examples - Test that Spec and Test files are detected as test files - Test that main Groovy files are not detected as tests - Test that directory scan finds Groovy test files - Test that project root detection works for Groovy projects
- CalculatorSpec.snapshot.json with Spock test methods - UserServiceTest.snapshot.json with test method - Update run.lua to handle .groovy extension for snapshots
cfaf248 to
1aa34ad
Compare
- Add Maven wrapper files to maven-groovy fixture - Update run-all.sh to find both Java and Groovy test files - Update snapshots to match current behavior (empty results) - Groovy test method discovery requires Groovy treesitter grammar
1aa34ad to
986db11
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for detecting Groovy/Spock test files in addition to Java test files.
Changes
file_checker.lua: Strip.groovyextension alongside.javawhen checking test patternspatterns.lua: AddGROOVY_TEST_FILE_PATTERNSconstant for external usefile_checker_spec.lua: Add tests for Groovy/Spock test file detectionHow it works
The existing
test_classname_patterns(e.g.,^.*Spec$,^.*Test$) already match Spock test class names. The fix was to ensure the file checker strips.groovyextension before matching against these patterns.Closes #194