From 756fba05679ad97ff357c6f15f01dd33b38e6fa9bd5f4c32bf4c0c2e9a7bae87 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 8 Apr 2024 19:00:35 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/tycho?expand=0&rev=56 --- tycho-surefire3.patch | 124 ++++++++++++++++++++++++++++++++++++++++++ tycho.spec | 2 + 2 files changed, 126 insertions(+) create mode 100644 tycho-surefire3.patch diff --git a/tycho-surefire3.patch b/tycho-surefire3.patch new file mode 100644 index 0000000..6538851 --- /dev/null +++ b/tycho-surefire3.patch @@ -0,0 +1,124 @@ +--- tycho-1.6.0/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java 2024-04-08 18:34:30.276480107 +0200 ++++ tycho-1.6.0/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java 2024-04-08 20:16:41.191547844 +0200 +@@ -17,15 +17,20 @@ + import java.io.FileInputStream; + import java.io.IOException; + import java.net.URL; ++import java.nio.charset.StandardCharsets; + import java.util.Collections; + import java.util.Enumeration; + import java.util.HashMap; ++import java.util.LinkedList; + import java.util.List; + import java.util.Map; + import java.util.Properties; + import java.util.Set; + + import org.apache.maven.plugin.surefire.StartupReportConfiguration; ++import org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter; ++import org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter; ++import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter; + import org.apache.maven.plugin.surefire.log.api.PrintStreamLogger; + import org.apache.maven.plugin.surefire.report.ConsoleReporter; + import org.apache.maven.plugin.surefire.report.DefaultReporterFactory; +@@ -33,19 +38,20 @@ + import org.apache.maven.surefire.booter.ClassLoaderConfiguration; + import org.apache.maven.surefire.booter.ClasspathConfiguration; + import org.apache.maven.surefire.booter.ForkedBooter; ++import org.apache.maven.surefire.booter.ProcessCheckerType; + import org.apache.maven.surefire.booter.PropertiesWrapper; + import org.apache.maven.surefire.booter.ProviderConfiguration; + import org.apache.maven.surefire.booter.ProviderFactory; +-import org.apache.maven.surefire.booter.Shutdown; ++import org.apache.maven.surefire.api.booter.Shutdown; + import org.apache.maven.surefire.booter.StartupConfiguration; +-import org.apache.maven.surefire.cli.CommandLineOption; +-import org.apache.maven.surefire.report.ReporterConfiguration; +-import org.apache.maven.surefire.report.ReporterFactory; +-import org.apache.maven.surefire.suite.RunResult; +-import org.apache.maven.surefire.testset.DirectoryScannerParameters; +-import org.apache.maven.surefire.testset.RunOrderParameters; +-import org.apache.maven.surefire.testset.TestListResolver; +-import org.apache.maven.surefire.testset.TestRequest; ++import org.apache.maven.surefire.api.cli.CommandLineOption; ++import org.apache.maven.surefire.api.report.ReporterConfiguration; ++import org.apache.maven.surefire.api.report.ReporterFactory; ++import org.apache.maven.surefire.api.suite.RunResult; ++import org.apache.maven.surefire.api.testset.DirectoryScannerParameters; ++import org.apache.maven.surefire.api.testset.RunOrderParameters; ++import org.apache.maven.surefire.api.testset.TestListResolver; ++import org.apache.maven.surefire.api.testset.TestRequest; + import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.IStatus; + import org.eclipse.core.runtime.Status; +@@ -81,8 +89,6 @@ + DumpStackTracesTimer.startStackDumpTimeoutTimer(timeoutParameter); + } + +- boolean forkRequested = true; +- boolean inForkedVM = true; + boolean useSystemClassloader = false; + boolean useManifestOnlyJar = false; + boolean useFile = true; +@@ -91,24 +97,27 @@ + + ClasspathConfiguration classPathConfig = new ClasspathConfiguration(false, false); + StartupConfiguration startupConfiguration = new StartupConfiguration(provider, classPathConfig, +- new ClassLoaderConfiguration(useSystemClassloader, useManifestOnlyJar), forkRequested, inForkedVM); ++ new ClassLoaderConfiguration(useSystemClassloader, useManifestOnlyJar), ProcessCheckerType.ALL, ++ new LinkedList()); + // TODO dir scanning with no includes done here (done in TestMojo already) + // but without dirScannerParams we get an NPE accessing runOrder + DirectoryScannerParameters dirScannerParams = new DirectoryScannerParameters(testClassesDir, + Collections. emptyList(), Collections. emptyList(), Collections. emptyList(), +- failIfNoTests, runOrder); ++ runOrder); + ReporterConfiguration reporterConfig = new ReporterConfiguration(reportsDir, trimStackTrace); + TestRequest testRequest = new TestRequest(suiteXmlFiles, testClassesDir, + TestListResolver.getEmptyTestListResolver()); + ProviderConfiguration providerConfiguration = new ProviderConfiguration(dirScannerParams, +- new RunOrderParameters(runOrder, null), failIfNoTests, reporterConfig, null, testRequest, ++ new RunOrderParameters(runOrder, null), reporterConfig, null, testRequest, + extractProviderProperties(testProps), null, false, Collections. emptyList(), + skipAfterFailureCount, Shutdown.DEFAULT, 30); + StartupReportConfiguration startupReportConfig = new StartupReportConfiguration(useFile, printSummary, +- ConsoleReporter.PLAIN, redirectTestOutputToFile, disableXmlReport, reportsDir, +- trimStackTrace, null, new File(reportsDir, "TESTHASH"), false, rerunFailingTestsCount, XSD, null, false); ++ ConsoleReporter.PLAIN, redirectTestOutputToFile, reportsDir, ++ trimStackTrace, null, new File(reportsDir, "TESTHASH"), false, rerunFailingTestsCount, XSD, ++ StandardCharsets.UTF_8.toString(), false, new SurefireStatelessReporter(disableXmlReport, null), ++ new SurefireConsoleOutputReporter(), new SurefireStatelessTestsetInfoReporter()); + ReporterFactory reporterFactory = new DefaultReporterFactory(startupReportConfig, +- new PrintStreamLogger(startupReportConfig.getOriginalSystemOut())); ++ new PrintStreamLogger(System.out)); + // API indicates we should use testClassLoader below but surefire also tries + // to load surefire classes using this classloader + RunResult result = ProviderFactory.invokeProvider(null, createCombinedClassLoader(testPlugin), reporterFactory, +--- tycho-1.6.0/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java 2024-04-08 18:34:30.283146821 +0200 ++++ tycho-1.6.0/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java 2024-04-08 20:34:27.396139564 +0200 +@@ -21,7 +21,7 @@ + import java.util.Set; + + import org.apache.maven.model.Dependency; +-import org.apache.maven.surefire.booter.ProviderParameterNames; ++import org.apache.maven.surefire.api.booter.ProviderParameterNames; + import org.codehaus.plexus.component.annotations.Component; + import org.eclipse.tycho.classpath.ClasspathEntry; + import org.eclipse.tycho.surefire.provider.spi.TestFrameworkProvider; +--- tycho-1.6.0/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java 2024-04-08 18:34:30.283146821 +0200 ++++ tycho-1.6.0/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java 2024-04-08 20:28:02.583270642 +0200 +@@ -48,10 +48,10 @@ + import org.apache.maven.repository.RepositorySystem; + import org.apache.maven.surefire.booter.BooterConstants; + import org.apache.maven.surefire.booter.PropertiesWrapper; +-import org.apache.maven.surefire.booter.ProviderParameterNames; +-import org.apache.maven.surefire.testset.TestListResolver; +-import org.apache.maven.surefire.util.DefaultScanResult; +-import org.apache.maven.surefire.util.ScanResult; ++import org.apache.maven.surefire.api.booter.ProviderParameterNames; ++import org.apache.maven.surefire.api.testset.TestListResolver; ++import org.apache.maven.surefire.api.util.DefaultScanResult; ++import org.apache.maven.surefire.api.util.ScanResult; + import org.apache.maven.toolchain.Toolchain; + import org.apache.maven.toolchain.ToolchainManager; + import org.codehaus.plexus.util.FileUtils; diff --git a/tycho.spec b/tycho.spec index 34d7b88..636bd95 100644 --- a/tycho.spec +++ b/tycho.spec @@ -69,6 +69,7 @@ Patch9: tycho-plexus-compiler-2.13.patch Patch10: tycho-sourcetarget.patch Patch11: tycho-getTimestamp.patch Patch12: tycho-surefire.patch +Patch13: tycho-surefire3.patch Patch100: fedoraproject-p2-bootstrap-fix.patch BuildRequires: bash BuildRequires: fdupes @@ -221,6 +222,7 @@ mv fedoraproject-p2-%{fp_p2_git_tag} fedoraproject-p2 %patch -P 10 -p1 %patch -P 11 -p1 %patch -P 12 -p1 +%patch -P 13 -p1 %patch -P 100 # Unneeded for RPM builds