bazel-contrib / bazel-contrib/rules_jvm_external

Fix Java integration tests to be compatible with OpenJDK 11

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Java
Stars
373
Forks
301
Avg merge
7d 17h
Merged PRs (30d)
3

Description

They were disabled in https://github.com/bazelbuild/rules_jvm_external/pull/127

```
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //tests/integration:ArtifactExclusionsTest
-----------------------------------------------------------------------------
JUnit4 Test Runner
.E
Time: 0.009
There was 1 failure:
1) test_excludedArtifacts_notOnClassPath(com.jvm.external.ArtifactExclusionsTest)
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at com.jvm.external.ArtifactExclusionsTest.test_excludedArtifacts_notOnClassPath(ArtifactExclusionsTest.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at com.google.testing.junit.runner.internal.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:89)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:153)
at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:84)

FAILURES!!!
Tests run: 1, Failures: 1

BazelTestRunner exiting with a return value of 1
JVM shutdown hooks (if any) will run now.
The JVM will exit once they complete.

-- JVM shutdown starting at 2019-04-25 09:29:31 --
```

Other logs: https://buildkite.com/bazel/rules-jvm-external/builds/390#b676ef53-ae08-46ce-ae22-a2d4bc336479

Contributor guide

Open the contributing guide

Research direction

Start with //tests/integration:ArtifactExclusionsTest and its failure at ArtifactExclusionsTest.java:16, then review pull request 127 to understand why these tests were disabled. Make the integration test pass on OpenJDK 11 without losing its artifact-exclusion check, and run the target to verify it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.