Closed wolfs closed 2 years ago
@wolfs I was able to get this working by adding jenkins-war
back to testRuntimeOnly
:
testRuntimeOnly 'org.jenkins-ci.main:jenkins-war:2.138.4'
I tried adding a org.jenkins-ci.modules:instance-identity:2.1 version to testImplementation, though the test keeps failing
This issue is annoying (#186), but it isn't the reason the test fails.
I tried the gradle jpi plugin versions and all of them work up to 0.42.0
97e53d54adc2d8d92c25dcd233b958b41f0854db removed jenkins-war
from the testRuntimeOnly
configuration in an effort to clean up the classpath. It looks like this was caused by the removal, though I'm not exactly sure why at the moment. I tried adding all of jenkins-war
's transitives to testRuntimeOnly
, but it still failed. The logs also confirm it's still being loaded from the predefined path even while it's on the testRuntimeClasspath
:
o.jvnet.hudson.test.WarExploder#findJenkinsWar: Using a predefined WAR file
I'm considering adding jenkins-war
back to the configuration in a future releasing by default, and allowing disabling this auto-add with a property. I was going down this road because in my own plugins I've shifted to making test
unit tests only with JUnit 5 and a custom integrationTest
task for tests that require the JUnit4 Jenkins Rule. The plugin automatically adding all of these transitive dependencies makes IDE autocomplete much more daunting.
Awesome, that worked. Thank you!
Version report
See the build scan: https://ge.gradle.org/s/7yrrxp2mfwsdg/tests/:test/hudson.plugins.gradle.GradlePluginIntegrationTest/Config%20roundtrip?top-execution=1
I am using this PR of the Gradle plugin: https://github.com/jenkinsci/gradle-plugin/pull/114
Reproduction steps
Run
./gradlew test --tests "hudson.plugins.gradle.GradlePluginIntegrationTest.Config roundtrip"
Results
Expected result:
The test passes.
Actual result:
The test fails with:
I tried adding a
org.jenkins-ci.modules:instance-identity:2.1
version totestImplementation
, though the test keeps failing: https://ge.gradle.org/s/qir5zxifplv5i/tests/:test/hudson.plugins.gradle.GradlePluginIntegrationTest/Config%20roundtrip?top-execution=1I tried the gradle jpi plugin versions and all of them work up to 0.42.0. Any idea what could be causing this?