feat: add Groovy/Spock test file pattern support#299
Draft
rcasia wants to merge 7 commits into
Draft
Conversation
Extend test file discovery to support .groovy files alongside .java. Adds GROOVY_TEST_FILE_PATTERNS and GROOVY_TEST_FILE_REGEXES to the patterns module and updates file_checker to strip .groovy extension when matching test class name patterns. Fixes #194
Add unit tests for Groovy file pattern matching in file_checker: - Groovy test file discovery (*Spec.groovy, *Test.groovy, *IT.groovy) - Groovy non-test file exclusion - Groovy files in main folder exclusion Add E2E test suite (groovy_support_spec.lua) with complete Maven+Groovy fixture: - CalculatorSpec.groovy - Spock specification tests (4 tests) - UserServiceTest.groovy - Groovy JUnit tests (4 tests, 1 intentional failure) - Tests verify discovery, execution, and pass/fail reporting Fixture includes pom.xml with GMavenPlus plugin, Spock dependency, and source files for both Java and Groovy tests. Fixes #194
55bf727 to
b00708f
Compare
Update run-all.sh to: - Discover and run all fixtures automatically (not just maven-simple) - Find both .java and .groovy test files in src/test/java and src/test/groovy - Support *Test, *Spec, and *IT naming conventions for both languages Update run.lua to: - Extract expected class name from .groovy files (not just .java) - Derive snapshot file names for .groovy test files Update minimal_init.lua to: - Include tests/e2e/*_spec.lua in test collection (previously only tests/unit) - Ensures groovy_support_spec.lua and full_workflow_spec.lua run in CI Fixes #194
Fixes exit code handling so fixtures without test files are skipped gracefully instead of counting as failures. Fixes #194
Fixes exit code handling so fixtures without test files are skipped gracefully instead of counting as failures. Fixes #194
Fixes exit code handling so fixtures without test files are skipped gracefully instead of counting as failures. Fixes #194
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
Add support for discovering and running Groovy/Spock test files () alongside Java test files.
Changes
What this enables
Users can now run Spock framework tests written in Groovy within Maven or Gradle projects. Files matching patterns like:
will be discovered and executed by neotest-java.
Backward compatibility
No breaking changes. Existing Java test detection continues to work unchanged.
Fixes #194