Tibor17 commented on a change in pull request #350:
URL: https://github.com/apache/maven-surefire/pull/350#discussion_r631486340
##########
File path:
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
##########
@@ -4215,4 +4213,14 @@ private Classpath setCachedClasspath( @Nonnull String
key, @Nonnull Set<Artifact
return classpath;
}
}
+
+ /**
+ * No tests run failures.
+ */
+ enum NoTestsFailureReason
Review comment:
It could be named `TestRunExpectation` in terms of positive outcome from
the plugin execution.
Now the enum is used only in the method `getEffectiveFailIfNoTests()` and
this method evaluates two config parameter if no tests were executed. So it is
negative result of the plugin, see this:
```
DefaultScanResult scan = scanForTestClasses();
if ( !hasSuiteXmlFiles() && scan.isEmpty() )
{
switch ( getEffectiveFailIfNoTests() )
{
case NO_TESTS_RUN:
throw new MojoFailureException(
"No tests were executed! (Set -DfailIfNoTests=false to
ignore this error.)" );
case NO_SPECIFIED_TESTS_RUN:
throw new MojoFailureException( "No tests matching pattern
\""
+ getSpecificTests().toString()
+ "\" were executed! (Set "
+ "-D" + getPluginName() +
".failIfNoSpecifiedTests=false to ignore this error.)" );
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]