Skip to content

Commit

Permalink
[SUREFIRE-1266] Skip junit dependency check if module has no tests to…
Browse files Browse the repository at this point in the history
… run

Don't require users to add junit dependencies on all projects when using
groups in surefire/failsafe at the reactor-level
  • Loading branch information
CMoH committed Nov 14, 2021
1 parent 5f0e415 commit 4e900b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ public void execute()
setupStuff();
Platform platform = PLATFORM.withJdkExecAttributesForTests( getEffectiveJvm() );

if ( verifyParameters() && !hasExecutedBefore() )
if ( verifyParameters( false ) && !hasExecutedBefore() )
{
DefaultScanResult scan = scanForTestClasses();
if ( !hasSuiteXmlFiles() && scan.isEmpty() )
Expand All @@ -944,6 +944,7 @@ public void execute()
return;
}
}
verifyParameters( true );
logReportsDirectory();
executeAfterPreconditionsChecked( scan, platform );
}
Expand Down Expand Up @@ -1101,7 +1102,7 @@ else if ( out.isDirectory() )
}
}

boolean verifyParameters()
boolean verifyParameters( boolean pluginActive )
throws MojoFailureException, MojoExecutionException
{
setProperties( new SurefireProperties( getProperties() ) );
Expand Down Expand Up @@ -1138,7 +1139,10 @@ boolean verifyParameters()
ensureParallelRunningCompatibility();
ensureThreadCountWithPerThread();
warnIfUselessUseSystemClassLoaderParameter();
warnIfDefunctGroupsCombinations();
if ( pluginActive )
{
warnIfDefunctGroupsCombinations();
}
warnIfRerunClashes();
warnIfWrongShutdownValue();
warnIfNotApplicableSkipAfterFailureCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@ protected String getEnableProcessChecker()

e.expect( MojoFailureException.class );
e.expectMessage( "Unexpected value 'fake' in the configuration parameter 'enableProcessChecker'." );
mojo.verifyParameters();
mojo.verifyParameters( true );
}

private void setProjectDepedenciesToMojo( Artifact... deps )
Expand Down

0 comments on commit 4e900b6

Please sign in to comment.