-
Enhancement
-
Resolution: Unresolved
-
Optional
-
None
-
None
-
None
-
None
This Jira is to force "Compile (no tests) with JDK X" to fail on all branches when there are compilation errors in the tests and make the errors clear in the output so it is easy and straightforward to spot and fix them.
Because mvn clean install -DskipTests will compile the tests but will not result in an error with exit code 1, CI will go through the "Compile (no tests) with JDK X" stage and proceed with the 20+ jobs after it returns without errors.
Depending on the kind of compilation error you have in your tests, it can take a while to figure it out.
For example, when backporting UNDERTOW-2405 to 2.2.x, I didn't notice that a test class was using JDK11 API and, hence, wouldn't compile. I assumed compilation was running without failures because "Compile (no tests) with JDK 8" had passed successfully. And, instead of outputing compilation errors, the affected jobs, which were jdk8-core-windows and jdk8-core-ubuntu, were both showing hard-to-track errors. For Ubuntu, the build would fail with:
[WARNING] Couldn't load group class 'io.undertow.testutils.category.UnitTest' in Surefire|Failsafe plugin. The group class is ignored! # Created at 2024-06-21T23:24:20.324 java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) at java.lang.Class.createAnnotationData(Class.java:3521) at java.lang.Class.annotationData(Class.java:3510) at java.lang.Class.getAnnotation(Class.java:3415) at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:66) at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:53) at org.apache.maven.surefire.common.junit48.JUnit48TestChecker.accept(JUnit48TestChecker.java:51) at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:102) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.scanClassPath(JUnitCoreProvider.java:293) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.setTestsToRun(JUnitCoreProvider.java:199) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:133) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
For Windows core JDK8, a few tests were failing with the error below, but several tests were just passing ok at the very same job, with mixed up results:
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: io/undertow/testutils/HttpClientUtils at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.undertow.server.handlers.file.FileHandlerStressTestCase.simpleFileStressTest(FileHandlerStressTestCase.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
Notice that the class with the compilation error was none of the classes mentioned in the errors above.