JetBrains / bazel-bsp

An implementation of the Build Server Protocol for Bazel

Home Page:https://youtrack.jetbrains.com/issues/BAZEL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JUnit tests don't work

lukaszwawrzyk opened this issue · comments

Running jUnit tests doesn't seem to work, even though explicitly depending on junit 4. It is reproducible on bazel-bsp project itself. I get this error:

/private/var/tmp/_bazel_uwawrzyk/125c7a6ca879ed16a4b4b1a74bc5f27b/external/local_jdk/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:/Applications/Twitter IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=52938:/Applications/Twitter IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /private/var/folders/lb/5528kmts3z78dm_dcg3nlp_h0000gn/T/classpath288187603.jar com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.jetbrains.bsp.bazel.server.bsp.utils.BuildRuleAttributeExtractorTest
!!! JUnit version 3.8 or later expected:

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file junit/framework/ComparisonFailure
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at com.intellij.rt.junit.JUnitStarter.junitVersionChecks(JUnitStarter.java:214)
	at com.intellij.rt.junit.JUnitStarter.canWorkWithJUnitVersion(JUnitStarter.java:198)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:46)

Process finished with exit code 253

Upon testing, I found this message in the logs:

2021-12-21 10:23:24,736 [ 333770]  ERROR - .bsp.protocol.BspCommunication - Error while fetching test environment from BSP: Build Server does not support buildTarget/jvmTestEnvironment endpoint 
java.lang.Throwable: Error while fetching test environment from BSP: Build Server does not support buildTarget/jvmTestEnvironment endpoint
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at org.jetbrains.bsp.project.test.environment.BspFetchEnvironmentTaskProvider.executeTask(BspFetchEnvironmentTaskProvider.scala:67)
	at org.jetbrains.bsp.project.test.environment.BspFetchEnvironmentTaskProvider.executeTask(BspFetchEnvironmentTaskProvider.scala:21)
	at com.intellij.execution.impl.ExecutionManagerImpl$compileAndRun$1.run(ExecutionManagerImpl.kt:397)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)
2021-12-21 10:23:24,739 [ 333773]  ERROR - .bsp.protocol.BspCommunication - IntelliJ IDEA 2021.2.3  Build #IC-212.5457.46 
2021-12-21 10:23:24,739 [ 333773]  ERROR - .bsp.protocol.BspCommunication - JDK: 11.0.12; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2021-12-21 10:23:24,740 [ 333774]  ERROR - .bsp.protocol.BspCommunication - OS: Mac OS X 

Wonder how that missing request to this error message