-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failure with configuration-as-code plugin when upgrading (#JENKIN…
…S-73843) (#495)
- Loading branch information
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/test/groovy/hudson/plugins/gradle/injection/InjectionConfigWithCasCTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package hudson.plugins.gradle.injection | ||
|
||
|
||
import hudson.plugins.gradle.AbstractIntegrationTest | ||
import io.jenkins.plugins.casc.misc.ConfiguredWithCode | ||
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule | ||
import org.junit.Rule | ||
import org.junit.rules.RuleChain | ||
import spock.lang.Subject | ||
import spock.lang.Unroll | ||
|
||
@Unroll | ||
@Subject(InjectionConfig.class) | ||
class InjectionConfigWithCasCTest extends AbstractIntegrationTest { | ||
@Rule | ||
public final RuleChain rules = RuleChain.outerRule(noSpaceInTmpDirs).around(new JenkinsConfiguredWithCodeRule()) | ||
|
||
@ConfiguredWithCode("injection-config.yml") | ||
def 'current configuration is readable with JCasC'() { | ||
expect: | ||
with(InjectionConfig.get()) { | ||
it.allowUntrusted == true | ||
it.ccudExtensionCustomCoordinates == "mycustom-ccud:ext" | ||
it.ccudExtensionVersion == "2.0.1" | ||
it.ccudPluginVersion == "2.0.2" | ||
it.checkForBuildAgentErrors == true | ||
it.enabled == true | ||
it.enforceUrl == true | ||
it.gradleCaptureTaskInputFiles == true | ||
it.gradleInjectionDisabledNodes*.label == ["non-gradle-node"] | ||
it.gradleInjectionEnabledNodes*.label == ["gradle-node"] | ||
it.gradlePluginRepositoryUrl == "https://plugins.gradle.org" | ||
it.gradlePluginVersion == "3.18.1" | ||
it.injectMavenExtension == true | ||
it.injectCcudExtension == true | ||
it.mavenCaptureGoalInputFiles == true | ||
it.mavenExtensionCustomCoordinates == "mycustom:ext" | ||
it.mavenExtensionRepositoryUrl == "https://repo1.maven.org/maven2" | ||
it.mavenExtensionVersion == "1.22.1" | ||
it.mavenInjectionDisabledNodes*.label == ["non-maven-node"] | ||
it.mavenInjectionEnabledNodes*.label == ["maven-node"] | ||
it.server == "http://localhost:5086" | ||
it.shortLivedTokenExpiry == 24 | ||
it.vcsRepositoryFilter == "+:myrepo" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
jenkins: | ||
unclassified: | ||
injectionConfig: | ||
allowUntrusted: true | ||
ccudExtensionCustomCoordinates: "mycustom-ccud:ext" | ||
ccudExtensionVersion: "2.0.1" | ||
ccudPluginVersion: "2.0.2" | ||
checkForBuildAgentErrors: true | ||
enabled: true | ||
enforceUrl: true | ||
gradleCaptureTaskInputFiles: true | ||
gradleInjectionDisabledNodes: | ||
- label: "non-gradle-node" | ||
gradleInjectionEnabledNodes: | ||
- label: "gradle-node" | ||
gradlePluginRepositoryUrl: "https://plugins.gradle.org" | ||
gradlePluginVersion: "3.18.1" | ||
injectMavenExtension: true | ||
injectCcudExtension: true | ||
mavenCaptureGoalInputFiles: true | ||
mavenExtensionCustomCoordinates: "mycustom:ext" | ||
mavenExtensionRepositoryUrl: "https://repo1.maven.org/maven2" | ||
mavenExtensionVersion: "1.22.1" | ||
mavenInjectionDisabledNodes: | ||
- label: "non-maven-node" | ||
mavenInjectionEnabledNodes: | ||
- label: "maven-node" | ||
server: "http://localhost:5086" | ||
shortLivedTokenExpiry: 24 | ||
vcsRepositoryFilter: "+:myrepo" |