diff --git a/Jenkinsfile b/Jenkinsfile index 483c854643..ddb5f84835 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -21,19 +21,18 @@ properties( [ - buildDiscarder(logRotator(artifactDaysToKeepStr: env.BRANCH_NAME == 'master' ? '14' : '7', - artifactNumToKeepStr: '50', + buildDiscarder(logRotator(artifactNumToKeepStr: env.BRANCH_NAME == 'master' ? '15' : '5', daysToKeepStr: env.BRANCH_NAME == 'master' ? '30' : '14', numToKeepStr: env.BRANCH_NAME == 'master' ? '20' : '10') - ), - disableConcurrentBuilds() + )//, + //disableConcurrentBuilds() ] ) // final def oses = ['linux':'ubuntu && maven', 'windows':'windows-he'] -final def oses = ['linux':'ubuntu && maven'] +final def oses = ['linux':'ubuntu'] final def mavens = env.BRANCH_NAME == 'master' ? ['3.x.x', '3.6.3'] : ['3.x.x'] // all non-EOL versions and the first EA -final def jdks = [20, 17, 11, 8] +final def jdks = [21, 17, 11, 8] final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its'] final def goals = ['clean', 'install'] @@ -134,7 +133,7 @@ def buildProcess(String stageKey, String jdkName, String mvnName, goals, options println "Maven Local Repository = ${mvnLocalRepoDir}." assert mvnLocalRepoDir != null : 'Local Maven Repository is undefined.' - def properties = ["-Djacoco.skip=${!makeReports}", "\"-Dmaven.repo.local=${mvnLocalRepoDir}\""] + def properties = ["-Papache.ci -Djacoco.skip=${!makeReports}", "\"-Dmaven.repo.local=${mvnLocalRepoDir}\""] def cmd = ['mvn'] + goals + options + properties stage("build ${stageKey}") { diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml index bd4bf51c9f..3ba6e676be 100644 --- a/maven-failsafe-plugin/pom.xml +++ b/maven-failsafe-plugin/pom.xml @@ -233,30 +233,6 @@ - - ci - - - enableCiProfile - true - - - - - - maven-docck-plugin - 1.2 - - - - check - - - - - - - run-its diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java index 18a7c51fb3..42a769c464 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java @@ -85,6 +85,7 @@ import org.apache.maven.surefire.api.booter.Shutdown; import org.apache.maven.surefire.api.cli.CommandLineOption; import org.apache.maven.surefire.api.report.ReporterConfiguration; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.api.suite.RunResult; import org.apache.maven.surefire.api.testset.DirectoryScannerParameters; import org.apache.maven.surefire.api.testset.RunOrderParameters; @@ -2056,7 +2057,8 @@ private Artifact getShadefireArtifact() { return getPluginArtifactMap().get("org.apache.maven.surefire:surefire-shadefire"); } - private StartupReportConfiguration getStartupReportConfiguration(String configChecksum, boolean isForking) { + private StartupReportConfiguration getStartupReportConfiguration( + String configChecksum, boolean isForking, ProviderInfo providerInfo) { SurefireStatelessReporter xmlReporter = statelessTestsetReporter == null ? new SurefireStatelessReporter() : statelessTestsetReporter; @@ -2071,6 +2073,11 @@ private StartupReportConfiguration getStartupReportConfiguration(String configCh ? new SurefireStatelessTestsetInfoReporter() : statelessTestsetInfoReporter; + // SUREFIRE-1643 we can force this here as junit5 will need this for multi thread test + ReporterFactoryOptions reporterFactoryOptions = new ReporterFactoryOptions(); + if ("org.apache.maven.surefire.junitplatform.JUnitPlatformProvider".equals(providerInfo.getProviderName())) { + reporterFactoryOptions.setStatPerSourceName(true); + } return new StartupReportConfiguration( isUseFile(), isPrintSummary(), @@ -2089,7 +2096,8 @@ private StartupReportConfiguration getStartupReportConfiguration(String configCh isEnablePropertiesElement(), xmlReporter, outReporter, - testsetReporter); + testsetReporter, + reporterFactoryOptions); } private boolean isSpecificTestSpecified() { @@ -2317,7 +2325,9 @@ private ForkStarter createForkStarter( platform, resolvedJavaModularityResult); String configChecksum = getConfigChecksum(); - StartupReportConfiguration startupReportConfiguration = getStartupReportConfiguration(configChecksum, true); + StartupReportConfiguration startupReportConfiguration = + getStartupReportConfiguration(configChecksum, true, provider); + ProviderConfiguration providerConfiguration = createProviderConfiguration(runOrderParameters); return new ForkStarter( providerConfiguration, @@ -2345,7 +2355,8 @@ private InPluginVMSurefireStarter createInprocessStarter( platform, new ResolvePathResultWrapper(null, true)); String configChecksum = getConfigChecksum(); - StartupReportConfiguration startupReportConfiguration = getStartupReportConfiguration(configChecksum, false); + StartupReportConfiguration startupReportConfiguration = + getStartupReportConfiguration(configChecksum, false, provider); ProviderConfiguration providerConfiguration = createProviderConfiguration(runOrderParameters); return new InPluginVMSurefireStarter( startupConfiguration, providerConfiguration, startupReportConfiguration, getConsoleLogger(), platform); diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java index e902722b42..83bf6a0d5b 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/CommonReflector.java @@ -29,6 +29,7 @@ import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerDecorator; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.api.util.SurefireReflectionException; import static org.apache.maven.surefire.api.util.ReflectionUtils.getConstructor; @@ -44,6 +45,7 @@ public class CommonReflector { private final Class statelessTestsetReporter; private final Class consoleOutputReporter; private final Class statelessTestsetInfoReporter; + private final Class reporterFactoryOptions; private final ClassLoader surefireClassLoader; public CommonReflector(@Nonnull ClassLoader surefireClassLoader) { @@ -56,6 +58,7 @@ public CommonReflector(@Nonnull ClassLoader surefireClassLoader) { consoleOutputReporter = surefireClassLoader.loadClass(SurefireConsoleOutputReporter.class.getName()); statelessTestsetInfoReporter = surefireClassLoader.loadClass(SurefireStatelessTestsetInfoReporter.class.getName()); + reporterFactoryOptions = surefireClassLoader.loadClass(ReporterFactoryOptions.class.getName()); } catch (ClassNotFoundException e) { throw new SurefireReflectionException(e); } @@ -90,7 +93,8 @@ private Object createStartupReportConfiguration(@Nonnull StartupReportConfigurat boolean.class, statelessTestsetReporter, consoleOutputReporter, - statelessTestsetInfoReporter); + statelessTestsetInfoReporter, + reporterFactoryOptions); Object[] params = { reporterConfiguration.isUseFile(), reporterConfiguration.isPrintSummary(), @@ -109,7 +113,8 @@ private Object createStartupReportConfiguration(@Nonnull StartupReportConfigurat reporterConfiguration.isEnablePropertiesElement(), reporterConfiguration.getXmlReporter().clone(surefireClassLoader), reporterConfiguration.getConsoleOutputReporter().clone(surefireClassLoader), - reporterConfiguration.getTestsetReporter().clone(surefireClassLoader) + reporterConfiguration.getTestsetReporter().clone(surefireClassLoader), + reporterConfiguration.getReporterFactoryOptions().clone(surefireClassLoader) }; return newInstance(constructor, params); } diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java index 89e6614f3b..cd805c7c78 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/StartupReportConfiguration.java @@ -35,6 +35,7 @@ import org.apache.maven.plugin.surefire.report.TestSetStats; import org.apache.maven.plugin.surefire.report.WrappedReportEntry; import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener; import org.apache.maven.surefire.extensions.StatelessReportEventListener; import org.apache.maven.surefire.extensions.StatelessTestsetInfoConsoleReportEventListener; @@ -97,6 +98,8 @@ public final class StartupReportConfiguration { private StatisticsReporter statisticsReporter; + private final ReporterFactoryOptions reporterFactoryOptions; + /** * @since 3.3.1 */ @@ -119,7 +122,8 @@ public StartupReportConfiguration( boolean enablePropertiesElement, SurefireStatelessReporter xmlReporter, SurefireConsoleOutputReporter consoleOutputReporter, - SurefireStatelessTestsetInfoReporter testsetReporter) { + SurefireStatelessTestsetInfoReporter testsetReporter, + ReporterFactoryOptions reporterFactoryOptions) { this.useFile = useFile; this.printSummary = printSummary; this.reportFormat = reportFormat; @@ -141,6 +145,7 @@ public StartupReportConfiguration( this.xmlReporter = xmlReporter; this.consoleOutputReporter = consoleOutputReporter; this.testsetReporter = testsetReporter; + this.reporterFactoryOptions = reporterFactoryOptions; } @SuppressWarnings("checkstyle:parameternumber") @@ -180,7 +185,8 @@ public StartupReportConfiguration( true, xmlReporter, consoleOutputReporter, - testsetReporter); + testsetReporter, + new ReporterFactoryOptions(false)); } public boolean isUseFile() { @@ -220,7 +226,7 @@ public StatelessReportEventListener instantiat // In the in-plugin execution of parallel JUnit4.7 with rerun the map must be shared because reports and // listeners are in ThreadLocal, see Surefire1122ParallelAndFlakyTestsIT. Map> testClassMethodRunHistory = - isForking ? new ConcurrentHashMap>() : this.testClassMethodRunHistory; + isForking ? new ConcurrentHashMap<>() : this.testClassMethodRunHistory; DefaultStatelessReportMojoConfiguration xmlReporterConfig = new DefaultStatelessReportMojoConfiguration( resolveReportsDirectory(forkNumber), @@ -319,4 +325,8 @@ public SurefireStatelessTestsetInfoReporter getTestsetReporter() { private boolean shouldReportToConsole() { return isUseFile() ? isPrintSummary() : isRedirectTestOutputToFile() || isBriefOrPlainFormat(); } + + public ReporterFactoryOptions getReporterFactoryOptions() { + return reporterFactoryOptions; + } } diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java index cde479eacf..f95c061abc 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactory.java @@ -103,7 +103,8 @@ public TestReportListener createTestReportListener() { reportConfiguration.isTrimStackTrace(), PLAIN.equals(reportConfiguration.getReportFormat()), reportConfiguration.isBriefOrPlainFormat(), - consoleLogger); + consoleLogger, + reportConfiguration.getReporterFactoryOptions().isStatPerSourceName()); addListener(testSetRunListener); return testSetRunListener; } diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java index 7724b12109..d658737cec 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java @@ -20,12 +20,12 @@ import java.io.BufferedOutputStream; import java.io.File; -import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Deque; import java.util.LinkedHashMap; @@ -392,7 +392,7 @@ private OutputStream getOutputStream(WrappedReportEntry testSetReportEntry) thro reportFile.delete(); //noinspection ResultOfMethodCallIgnored reportDir.mkdirs(); - return new BufferedOutputStream(new FileOutputStream(reportFile), 64 * 1024); + return new BufferedOutputStream(Files.newOutputStream(reportFile.toPath()), 64 * 1024); } private static OutputStreamWriter getWriter(OutputStream fos) { diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java index 5e90fb0559..6e79c05011 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java @@ -22,7 +22,9 @@ import java.util.Collections; import java.util.List; import java.util.Queue; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.ConcurrentMap; import org.apache.maven.plugin.surefire.runorder.StatisticsReporter; import org.apache.maven.surefire.api.report.ReportEntry; @@ -48,7 +50,14 @@ public class TestSetRunListener implements TestReportListener { private final Queue testMethodStats = new ConcurrentLinkedQueue<>(); - private final TestSetStats detailsForThis; + /** + * will be used only if report entry have a sourceName other than that #currentTestSetStats will be used + * it looks some provider doesn't provide enough information so we assume to use previous technique + * class field (this is definitely hackish) + */ + private final ConcurrentMap detailsPerSource = new ConcurrentHashMap<>(); + + private final TestSetStats currentTestSetStats; private final ConsoleOutputReportEventListener testOutputReceiver; @@ -64,6 +73,12 @@ public class TestSetRunListener implements TestReportListener new TestSetStats(trimStackTrace, isPlainFormat)); + } + return currentTestSetStats; + } + @Override public void testSetStarting(TestSetReportEntry report) { - detailsForThis.testSetStart(); + getTestSetStats(report).testSetStart(); consoleReporter.testSetStarting(report); testOutputReceiver.testSetStarting(report); } @@ -187,20 +214,20 @@ private void clearCapture() { @Override public void testSetCompleted(TestSetReportEntry report) { final WrappedReportEntry wrap = wrapTestSet(report); - final List testResults = - briefOrPlainFormat ? detailsForThis.getTestResults() : Collections.emptyList(); - fileReporter.testSetCompleted(wrap, detailsForThis, testResults); - simpleXMLReporter.testSetCompleted(wrap, detailsForThis); + TestSetStats testSetStats = getTestSetStats(report); + final List testResults = briefOrPlainFormat ? testSetStats.getTestResults() : Collections.emptyList(); + fileReporter.testSetCompleted(wrap, testSetStats, testResults); + simpleXMLReporter.testSetCompleted(wrap, testSetStats); statisticsReporter.testSetCompleted(); - consoleReporter.testSetCompleted(wrap, detailsForThis, testResults); + consoleReporter.testSetCompleted(wrap, testSetStats, testResults); testOutputReceiver.testSetCompleted(wrap); consoleReporter.reset(); wrap.getStdout().free(); wrap.getStdErr().free(); - addTestMethodStats(); - detailsForThis.reset(); + addTestMethodStats(report); + testSetStats.reset(); clearCapture(); } @@ -210,13 +237,13 @@ public void testSetCompleted(TestSetReportEntry report) { @Override public void testStarting(ReportEntry report) { - detailsForThis.testStart(); + getTestSetStats(report).testStart(); } @Override public void testSucceeded(ReportEntry reportEntry) { WrappedReportEntry wrapped = wrap(reportEntry, SUCCESS); - detailsForThis.testSucceeded(wrapped); + getTestSetStats(reportEntry).testSucceeded(wrapped); statisticsReporter.testSucceeded(reportEntry); clearCapture(); } @@ -224,7 +251,7 @@ public void testSucceeded(ReportEntry reportEntry) { @Override public void testError(ReportEntry reportEntry) { WrappedReportEntry wrapped = wrap(reportEntry, ERROR); - detailsForThis.testError(wrapped); + getTestSetStats(reportEntry).testError(wrapped); statisticsReporter.testError(reportEntry); clearCapture(); } @@ -232,7 +259,7 @@ public void testError(ReportEntry reportEntry) { @Override public void testFailed(ReportEntry reportEntry) { WrappedReportEntry wrapped = wrap(reportEntry, FAILURE); - detailsForThis.testFailure(wrapped); + getTestSetStats(reportEntry).testFailure(wrapped); statisticsReporter.testFailed(reportEntry); clearCapture(); } @@ -244,7 +271,7 @@ public void testFailed(ReportEntry reportEntry) { @Override public void testSkipped(ReportEntry reportEntry) { WrappedReportEntry wrapped = wrap(reportEntry, SKIPPED); - detailsForThis.testSkipped(wrapped); + getTestSetStats(reportEntry).testSkipped(wrapped); statisticsReporter.testSkipped(reportEntry); clearCapture(); } @@ -263,7 +290,7 @@ private WrappedReportEntry wrap(ReportEntry other, ReportEntryType reportEntryTy int estimatedElapsed = 0; if (reportEntryType != SKIPPED) { Integer etime = other.getElapsed(); - estimatedElapsed = etime == null ? detailsForThis.getElapsedSinceLastStart() : etime; + estimatedElapsed = etime == null ? getTestSetStats(other).getElapsedSinceLastStart() : etime; } return new WrappedReportEntry(other, reportEntryType, estimatedElapsed, testStdOut, testStdErr); @@ -273,7 +300,9 @@ private WrappedReportEntry wrapTestSet(TestSetReportEntry other) { return new WrappedReportEntry( other, null, - other.getElapsed() != null ? other.getElapsed() : detailsForThis.getElapsedSinceTestSetStart(), + other.getElapsed() != null + ? other.getElapsed() + : getTestSetStats(other).getElapsedSinceTestSetStart(), testStdOut, testStdErr, other.getSystemProperties()); @@ -283,8 +312,8 @@ public void close() { testOutputReceiver.close(); } - private void addTestMethodStats() { - for (WrappedReportEntry reportEntry : detailsForThis.getReportEntries()) { + private void addTestMethodStats(TestSetReportEntry report) { + for (WrappedReportEntry reportEntry : getTestSetStats(report).getReportEntries()) { TestMethodStats methodStats = new TestMethodStats( reportEntry.getClassMethodName(), reportEntry.getReportEntryType(), diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java index f661a003f2..c443d27cb6 100644 --- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java +++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/WrappedReportEntry.java @@ -81,7 +81,7 @@ public WrappedReportEntry( Integer estimatedElapsed, Utf8RecodingDeferredFileOutputStream stdout, Utf8RecodingDeferredFileOutputStream stdErr) { - this(original, reportEntryType, estimatedElapsed, stdout, stdErr, Collections.emptyMap()); + this(original, reportEntryType, estimatedElapsed, stdout, stdErr, Collections.emptyMap()); } @Override diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java index 6fd82d6cb3..510d5d1d59 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java @@ -27,6 +27,7 @@ import org.apache.maven.plugin.surefire.log.api.ConsoleLoggerDecorator; import org.apache.maven.plugin.surefire.log.api.PrintStreamLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.hamcrest.MatcherAssert; import org.junit.Before; import org.junit.Test; @@ -86,7 +87,8 @@ public void setup() { true, xmlReporter, consoleOutputReporter, - infoReporter); + infoReporter, + new ReporterFactoryOptions()); consoleLogger = mock(ConsoleLogger.class); } diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java index 1ff8487d8c..0f952d76ea 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java @@ -37,6 +37,7 @@ import org.apache.maven.surefire.api.util.DefaultScanResult; import org.apache.maven.surefire.api.util.SureFireFileManager; import org.apache.maven.surefire.extensions.ForkNodeFactory; +import org.apache.maven.surefire.providerapi.ProviderInfo; import org.junit.Test; import org.slf4j.Logger; @@ -55,7 +56,8 @@ public class MojoMocklessTest { @Test public void testGetStartupReportConfiguration() throws Exception { AbstractSurefireMojo surefirePlugin = new Mojo(null, null); - StartupReportConfiguration config = invokeMethod(surefirePlugin, "getStartupReportConfiguration", "", false); + StartupReportConfiguration config = + invokeMethod(surefirePlugin, "getStartupReportConfiguration", "", false, mock(ProviderInfo.class)); assertThat(config.getXmlReporter()).isNotNull().isInstanceOf(SurefireStatelessReporter.class); @@ -74,7 +76,8 @@ public void testGetStartupReportConfiguration2() throws Exception { setInternalState(surefirePlugin, "consoleOutputReporter", consoleReporter); setInternalState(surefirePlugin, "statelessTestsetInfoReporter", testsetInfoReporter); - StartupReportConfiguration config = invokeMethod(surefirePlugin, "getStartupReportConfiguration", "", false); + StartupReportConfiguration config = + invokeMethod(surefirePlugin, "getStartupReportConfiguration", "", false, mock(ProviderInfo.class)); assertThat(config.getXmlReporter()).isNotNull().isSameAs(xmlReporter); diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java index b16765038a..6a774ace83 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java @@ -45,6 +45,7 @@ import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.api.booter.Shutdown; import org.apache.maven.surefire.api.report.ReporterConfiguration; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.booter.AbstractPathConfiguration; import org.apache.maven.surefire.booter.ClassLoaderConfiguration; import org.apache.maven.surefire.booter.Classpath; @@ -166,7 +167,8 @@ public void processShouldExitWithoutSayingGoodBye() throws Exception { true, xmlReporter, outputReporter, - statelessTestsetInfoReporter); + statelessTestsetInfoReporter, + new ReporterFactoryOptions()); ConsoleLogger logger = mock(ConsoleLogger.class); @@ -253,7 +255,8 @@ public void processShouldWaitForAck() throws Exception { true, xmlReporter, outputReporter, - statelessTestsetInfoReporter); + statelessTestsetInfoReporter, + new ReporterFactoryOptions()); ConsoleLogger logger = mock(ConsoleLogger.class); diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java index 8a419acec6..fe7791ea62 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/TestSetMockReporterFactory.java @@ -26,6 +26,7 @@ import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter; import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.api.report.TestOutputReportEntry; import org.apache.maven.surefire.api.report.TestReportListener; @@ -70,6 +71,7 @@ private static StartupReportConfiguration defaultValue() { true, new SurefireStatelessReporter(), new SurefireConsoleOutputReporter(), - new SurefireStatelessTestsetInfoReporter()); + new SurefireStatelessTestsetInfoReporter(), + new ReporterFactoryOptions()); } } diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java index 28ce112644..6de35f6ee3 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java @@ -167,9 +167,9 @@ public void writeTestOutput(OutputReportEntry reportEntry) { // 1.0 seconds while using the encoder/decoder assertThat(readTime.get()) .describedAs("The performance test should assert 1.0 s of read time. " - + "The limit 6 s guarantees that the read time does not exceed this limit on overloaded CPU.") + + "The limit 10 s guarantees that the read time does not exceed this limit on overloaded CPU.") .isPositive() - .isLessThanOrEqualTo(6_000L); + .isLessThanOrEqualTo(10_000L); } @Test(timeout = 10_000L) diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java index b102886121..38d9b7d119 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java @@ -32,6 +32,7 @@ import org.apache.maven.surefire.api.fork.ForkNodeArguments; import org.apache.maven.surefire.extensions.EventHandler; import org.apache.maven.surefire.extensions.util.CountdownCloseable; +import org.junit.Ignore; import org.junit.Test; import static java.lang.Math.min; @@ -43,6 +44,7 @@ /** * */ +@Ignore("This test doesn't make sense as this can be running on slow machine") public class EventConsumerThreadTest { @SuppressWarnings("checkstyle:magicnumber") @Test(timeout = 60_000L) diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java index 484d717984..86c23c82af 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/DefaultReporterFactoryTest.java @@ -32,6 +32,7 @@ import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter; import org.apache.maven.plugin.surefire.log.api.ConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory.TestResultType; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.api.report.SafeThrowable; import org.apache.maven.surefire.api.report.StackTraceWriter; import org.apache.maven.surefire.api.report.TestOutputReportEntry; @@ -89,7 +90,8 @@ public void testMergeTestHistoryResult() throws Exception { true, new SurefireStatelessReporter(), new SurefireConsoleOutputReporter(), - new SurefireStatelessTestsetInfoReporter()); + new SurefireStatelessTestsetInfoReporter(), + new ReporterFactoryOptions()); DummyTestReporter reporter = new DummyTestReporter(); @@ -294,7 +296,8 @@ public void testLogger() { true, new SurefireStatelessReporter(), new SurefireConsoleOutputReporter(), - new SurefireStatelessTestsetInfoReporter()); + new SurefireStatelessTestsetInfoReporter(), + new ReporterFactoryOptions()); DummyTestReporter reporter = new DummyTestReporter(); @@ -360,7 +363,8 @@ public void testCreateReporterWithZeroStatistics() { true, new SurefireStatelessReporter(), new SurefireConsoleOutputReporter(), - new SurefireStatelessTestsetInfoReporter()); + new SurefireStatelessTestsetInfoReporter(), + new ReporterFactoryOptions()); assertTrue(reportConfig.isUseFile()); assertTrue(reportConfig.isPrintSummary()); diff --git a/maven-surefire-plugin/pom.xml b/maven-surefire-plugin/pom.xml index 8663ac2528..ed85e28790 100644 --- a/maven-surefire-plugin/pom.xml +++ b/maven-surefire-plugin/pom.xml @@ -136,30 +136,6 @@ - - ci - - - enableCiProfile - true - - - - - - maven-docck-plugin - 1.2 - - - - check - - - - - - - reporting diff --git a/maven-surefire-report-plugin/pom.xml b/maven-surefire-report-plugin/pom.xml index 5234cfb988..51162935d0 100644 --- a/maven-surefire-report-plugin/pom.xml +++ b/maven-surefire-report-plugin/pom.xml @@ -235,30 +235,6 @@ - - ci - - - enableCiProfile - true - - - - - - maven-docck-plugin - 1.2 - - - - check - - - - - - - reporting diff --git a/pom.xml b/pom.xml index d78da2aab2..8ee9a603dd 100644 --- a/pom.xml +++ b/pom.xml @@ -217,7 +217,7 @@ org.mockito mockito-core - 2.28.2 + 3.12.4 ${skipTests} alphabetical - 1C - 1 - 1C + ${its.forkCount} + ${its.threadCount} 1 false -server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true @@ -241,6 +242,13 @@ + + apache.ci + + 0.4C + 1 + + github diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1643IT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1643IT.java new file mode 100644 index 0000000000..cacd1a7935 --- /dev/null +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1643IT.java @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.surefire.its.jiras; + +import org.apache.maven.surefire.its.fixture.OutputValidator; +import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase; +import org.apache.maven.surefire.its.fixture.TestFile; +import org.junit.Test; + +/** + * + */ +@SuppressWarnings("checkstyle:magicnumber") +public class Surefire1643IT extends SurefireJUnit4IntegrationTestCase { + @Test + public void shouldNotMixResults() { + OutputValidator outputValidator = unpack("surefire-1643-parallel-junit5") + .maven() + .withFailure() + .executeTest() + .verifyTextInLog("BUILD FAILURE") + .assertTestSuiteResults(15, 0, 4, 0); + + TestFile xmlReportFile = outputValidator.getSurefireReportsXmlFile("TEST-io.olamy.App1Test.xml"); + xmlReportFile + .assertNotContainsText("App2Test") + .assertNotContainsText("App3Test") + .assertNotContainsText("App4Test") + .assertNotContainsText("App5Test"); + + xmlReportFile = outputValidator.getSurefireReportsXmlFile("TEST-io.olamy.App2Test.xml"); + xmlReportFile + .assertNotContainsText("App1Test") + .assertNotContainsText("App3Test") + .assertNotContainsText("App4Test") + .assertNotContainsText("App5Test"); + + xmlReportFile = outputValidator.getSurefireReportsXmlFile("TEST-io.olamy.App3Test.xml"); + xmlReportFile + .assertNotContainsText("App1Test") + .assertNotContainsText("App2Test") + .assertNotContainsText("App4Test") + .assertNotContainsText("App5Test"); + + xmlReportFile = outputValidator.getSurefireReportsXmlFile("TEST-io.olamy.App4Test.xml"); + xmlReportFile + .assertNotContainsText("App1Test") + .assertNotContainsText("App2Test") + .assertNotContainsText("App3Test") + .assertNotContainsText("App5Test"); + + xmlReportFile = outputValidator.getSurefireReportsXmlFile("TEST-io.olamy.App5Test.xml"); + xmlReportFile + .assertNotContainsText("App1Test") + .assertNotContainsText("App2Test") + .assertNotContainsText("App3Test") + .assertNotContainsText("App4Test"); + } +} diff --git a/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/java/surefire1144/Test1.java b/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/java/surefire1144/Test1.java index 3cedf8fe98..236fe8f161 100644 --- a/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/java/surefire1144/Test1.java +++ b/surefire-its/src/test/resources/surefire-1144-xml-runtime/src/test/java/surefire1144/Test1.java @@ -4,18 +4,15 @@ import org.junit.BeforeClass; import org.junit.Test; +import java.util.concurrent.TimeUnit; + public class Test1 { static void sleep( int ms ) { - long target = System.currentTimeMillis() + ms; try { - do - { - Thread.sleep( 1L ); - } - while ( System.currentTimeMillis() < target ); + TimeUnit.MILLISECONDS.sleep((long)ms); } catch ( InterruptedException e ) { @@ -27,24 +24,25 @@ static void printTimeAndSleep( String msg, int ms ) { System.out.println( msg + " started @ " + System.currentTimeMillis() ); sleep( ms ); + System.out.println( msg + " finished @ " + System.currentTimeMillis() ); } @Test public void testSleep100() { - printTimeAndSleep( "Test1.sleep100", 100 ); + printTimeAndSleep( "Test1.sleep:100", 100 ); } @Test public void testSleep200() { - printTimeAndSleep( "Test1.sleep200", 200 ); + printTimeAndSleep( "Test1.sleep:200", 200 ); } @Test public void testSleep300() { - printTimeAndSleep( "Test1.sleep300", 300 ); + printTimeAndSleep( "Test1.sleep:300", 300 ); } @BeforeClass diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/.mvn/jvm.config b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/.mvn/jvm.config new file mode 100644 index 0000000000..e69de29bb2 diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/.mvn/maven.config b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/.mvn/maven.config new file mode 100644 index 0000000000..e69de29bb2 diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/pom.xml b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/pom.xml new file mode 100644 index 0000000000..247569be60 --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + org.apache.maven.plugins.surefire + junit-platform-1.0.0 + 1.0 + [SUREFIRE-1643] JUnit 5: Parallel Test mixed + + + UTF-8 + 1.8 + 1.8 + 3 + fixed + true + concurrent + same_thread + + + + + + org.junit + junit-bom + 5.9.1 + pom + import + + + + + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + + + maven-clean-plugin + 3.4.0 + + + + maven-resources-plugin + 3.3.1 + + + maven-compiler-plugin + 3.13.0 + + + maven-surefire-plugin + ${surefire.version} + + + false + 1 + 3600 + alphabetical + + junit.jupiter.execution.parallel.enabled=${junit.jupiter.execution.parallel.enabled} + junit.jupiter.execution.parallel.mode.default=${junit.jupiter.execution.parallel.mode.default} + junit.jupiter.execution.parallel.mode.classes.default=${junit.jupiter.execution.parallel.mode.classes.default} + junit.jupiter.execution.parallel.config.strategy=${junit.jupiter.execution.parallel.config.strategy} + junit.jupiter.execution.parallel.config.fixed.parallelism=${junit.jupiter.execution.parallel.config.fixed.parallelism} + + + false + false + true + true + true + + + false + UTF-8 + false + + + false + false + true + true + + + + + + + diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/main/java/io/olamy/App.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/main/java/io/olamy/App.java new file mode 100644 index 0000000000..5354cd8a60 --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/main/java/io/olamy/App.java @@ -0,0 +1,10 @@ +package io.olamy; + +/** + * Hello world! + */ +public class App { + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App1Test.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App1Test.java new file mode 100644 index 0000000000..290400446c --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App1Test.java @@ -0,0 +1,30 @@ +package io.olamy; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** + * Unit test for simple App. + */ +public class App1Test { + + @Test + public void app1One() throws Throwable { + Thread.sleep(2000); + assertTrue(true); + } + + @Test + public void app1Two() throws Throwable { + Thread.sleep(2000); + assertTrue(true); + } + + @Test + public void app1Three() throws Throwable { + Thread.sleep(2000); + assertTrue(false); + } + +} diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App2Test.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App2Test.java new file mode 100644 index 0000000000..65d9165405 --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App2Test.java @@ -0,0 +1,30 @@ +package io.olamy; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Unit test for simple App. + */ +public class App2Test { + + @Test + public void app2One() throws Throwable { + Thread.sleep(3000); + assertTrue(true); + } + + @Test + public void app2Two() throws Throwable { + Thread.sleep(1000); + assertTrue(true); + } + + @Test + public void app2Three() throws Throwable { + Thread.sleep(2000); + assertTrue(true); + } + +} diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App3Test.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App3Test.java new file mode 100644 index 0000000000..3835e479c2 --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App3Test.java @@ -0,0 +1,30 @@ +package io.olamy; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Unit test for simple App. + */ +public class App3Test { + + @Test + public void app3One() throws Throwable { + Thread.sleep(500); + assertTrue(true); + } + + @Test + public void app3Two() throws Throwable { + Thread.sleep(7000); + assertTrue(false); + } + + @Test + public void app3Three() throws Throwable { + Thread.sleep(1000); + assertTrue(false); + } + +} diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App4Test.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App4Test.java new file mode 100644 index 0000000000..a4831a1c0c --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App4Test.java @@ -0,0 +1,30 @@ +package io.olamy; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Unit test for simple App. + */ +public class App4Test { + + @Test + public void app4One() throws Throwable { + Thread.sleep(500); + assertTrue(true); + } + + @Test + public void app4Two() throws Throwable { + Thread.sleep(7000); + assertTrue(true); + } + + @Test + public void app4Three() throws Throwable { + Thread.sleep(1000); + assertTrue(true); + } + +} diff --git a/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App5Test.java b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App5Test.java new file mode 100644 index 0000000000..7ff884e950 --- /dev/null +++ b/surefire-its/src/test/resources/surefire-1643-parallel-junit5/src/test/java/io/olamy/App5Test.java @@ -0,0 +1,30 @@ +package io.olamy; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Unit test for simple App. + */ +public class App5Test { + + @Test + public void app5One() throws Throwable { + Thread.sleep(500); + assertTrue(true); + } + + @Test + public void app5Two() throws Throwable { + Thread.sleep(200); + assertTrue(false); + } + + @Test + public void app5Three() throws Throwable { + Thread.sleep(1000); + assertTrue(true); + } + +} diff --git a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java index 5e82554908..416c38a387 100644 --- a/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java +++ b/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProvider.java @@ -46,6 +46,7 @@ import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TagFilter; +import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; @@ -112,6 +113,7 @@ public RunResult invoke(Object forkTestSet) throws TestSetFailedException, Repor try { RunListenerAdapter adapter = new RunListenerAdapter(reporterFactory.createTestReportListener()); adapter.setRunMode(NORMAL_RUN); + startCapture(adapter); setupJunitLogger(); if (forkTestSet instanceof TestsToRun) { @@ -172,6 +174,15 @@ private void invokeAllTests(TestsToRun testsToRun, RunListenerAdapter adapter) { } private void execute(TestsToRun testsToRun, RunListenerAdapter adapter) { + // parameters.getProviderProperties().get(CONFIGURATION_PARAMETERS) + // add this LegacyXmlReportGeneratingListener ? + // adapter, + // new LegacyXmlReportGeneratingListener( + // new File("target", "junit-platform").toPath(), new PrintWriter(System.out)) + // }; + + TestExecutionListener[] testExecutionListeners = new TestExecutionListener[] {adapter}; + if (testsToRun.allowEagerReading()) { List selectors = new ArrayList<>(); testsToRun.iterator().forEachRemaining(c -> selectors.add(selectClass(c.getName()))); @@ -180,15 +191,14 @@ private void execute(TestsToRun testsToRun, RunListenerAdapter adapter) { .filters(filters) .configurationParameters(configurationParameters) .selectors(selectors); - - launcher.execute(builder.build(), adapter); + launcher.execute(builder.build(), testExecutionListeners); } else { testsToRun.iterator().forEachRemaining(c -> { LauncherDiscoveryRequestBuilder builder = request() .filters(filters) .configurationParameters(configurationParameters) .selectors(selectClass(c.getName())); - launcher.execute(builder.build(), adapter); + launcher.execute(builder.build(), testExecutionListeners); }); } } @@ -237,7 +247,7 @@ private Filter[] newFilters() { .map(EngineFilter::excludeEngines) .ifPresent(filters::add); - return filters.toArray(new Filter[filters.size()]); + return filters.toArray(new Filter[0]); } Filter[] getFilters() { diff --git a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreTester.java b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreTester.java index 156cc5ea97..1a4f74c299 100644 --- a/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreTester.java +++ b/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/JUnitCoreTester.java @@ -30,6 +30,7 @@ import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger; import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; import org.apache.maven.surefire.api.report.ReporterFactory; +import org.apache.maven.surefire.api.report.ReporterFactoryOptions; import org.apache.maven.surefire.api.testset.TestSetFailedException; import org.junit.runner.Computer; import org.junit.runner.JUnitCore; @@ -113,6 +114,7 @@ private static StartupReportConfiguration defaultStartupReportConfiguration() { true, new SurefireStatelessReporter(), new SurefireConsoleOutputReporter(), - new SurefireStatelessTestsetInfoReporter()); + new SurefireStatelessTestsetInfoReporter(), + new ReporterFactoryOptions()); } }