Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to 0.43.0 breaks the gradle-plugin build #190

Closed
wolfs opened this issue Jun 30, 2021 · 2 comments
Closed

Upgrading to 0.43.0 breaks the gradle-plugin build #190

wolfs opened this issue Jun 30, 2021 · 2 comments

Comments

@wolfs
Copy link
Member

wolfs commented Jun 30, 2021

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: jenkinsci/gradle-plugin#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:

Caused: com.google.inject.ProvisionException: Unable to provision, see the following errors: |  
-- | --
  |   |  
  | 1) Error injecting constructor, java.security.KeyStoreException: JENKINS-41987: no X509Certificate found; perhaps instance-identity module is missing or too old |  
  | at jenkins.slaves.JnlpSlaveAgentProtocol4.<init>(JnlpSlaveAgentProtocol4.java:103)

I tried adding a org.jenkins-ci.modules:instance-identity:2.1 version to testImplementation, though the test keeps failing: https://ge.gradle.org/s/qir5zxifplv5i/tests/:test/hudson.plugins.gradle.GradlePluginIntegrationTest/Config%20roundtrip?top-execution=1

Caused by: com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException: 404 Not Found for http://localhost:62586/jenkins/static/7491ace6/assets/jquery-detached/jsmodules/jquery2.js

I tried the gradle jpi plugin versions and all of them work up to 0.42.0. Any idea what could be causing this?

@sghill
Copy link

sghill commented Oct 22, 2021

@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

97e53d5 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.

jamietanna added a commit to jenkinsci/job-dsl-plugin that referenced this issue Oct 27, 2021
Unfortunately tests were failing after the upgrade to JPI plugin
v0.43.0, due to [0].

To solve this, we make sure we re-add it for runtime only, using the
Jenkins version we're targeting.

[0]: jenkinsci/gradle-jpi-plugin#190 (comment)
wolfs added a commit to wolfs/gradle-plugin that referenced this issue Jan 8, 2022
@wolfs
Copy link
Member Author

wolfs commented Jan 8, 2022

Awesome, that worked. Thank you!

@wolfs wolfs closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants