Skip to content

Commit 29dd7a3

Browse files
fix: add surefire.failIfNoSpecifiedTests for multi-module Maven builds
In multi-module projects like Guava, -Dtest=X filter matches zero tests in dependency modules built with -am, causing "No tests matching pattern" failures. Adding -Dsurefire.failIfNoSpecifiedTests=false allows modules with no matching tests to pass while still running the correct tests in the target module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a65f1d1 commit 29dd7a3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

codeflash/languages/java/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ def _run_maven_tests(
14961496
# -am = also make dependencies
14971497
# -DfailIfNoTests=false allows dependency modules without tests to pass
14981498
# -DskipTests=false overrides any skipTests=true in pom.xml
1499-
cmd.extend(["-pl", test_module, "-am", "-DfailIfNoTests=false", "-DskipTests=false"])
1499+
cmd.extend(["-pl", test_module, "-am", "-DfailIfNoTests=false", "-Dsurefire.failIfNoSpecifiedTests=false", "-DskipTests=false"])
15001500

15011501
if test_filter:
15021502
# Validate test filter to prevent command injection

0 commit comments

Comments
 (0)