jenkins-pipeline-shared-libraries-gradle-plugin: JENKINS-48885: JenkinsRule always returns null in getPluginManager().getPlugin() on new core versions
Sadly somehow workflow-aggregator plugin can not be found, even if it is on the plugin dependencies list.
pluginDependencies(Action {
dependency("org.jenkins-ci.plugins.workflow", "workflow-aggregator", "2.5")
dependency("org.jenkins-ci.plugins", "job-dsl", "1.69")
dependency("org.6wind.jenkins", "lockable-resources", "2.2")
dependency("org.jenkinsci.plugins", "pipeline-model-api", "1.2.5")
dependency("org.jenkinsci.plugins", "pipeline-model-declarative-agent", "1.1.1")
dependency("org.jenkinsci.plugins", "pipeline-model-definition", "1.2.5")
dependency("org.jenkinsci.plugins", "pipeline-model-extensions", "1.2.5")
})
Spock Test:
given:
FreeStyleProject freeStyleProject = rule.createFreeStyleProject('project')
def scripts = new ExecuteDslScripts()
scripts.scriptText = '''
pipelineJob("testPipeline") {}
""".stripIndent())
freeStyleProject.getBuildersList().add(scripts)
when:
QueueTaskFuture<WorkflowRun> futureRun = freeStyleProject.scheduleBuild2(0)
then:
// JenkinsRule has different assertion capabilities
WorkflowRun run = rule.assertBuildStatusSuccess(futureRun)
rule.assertLogContains('''test'''.stripIndent(), run)
Error:
ERROR: (script, line 2) plugin ‘workflow-aggregator’ needs to be installed
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 1
- Comments: 28 (10 by maintainers)
I was able to work around this issue using a variant of
TestDependenciesTaskwithjavaConvention.sourceSets.test.output.resourcesDirchanged tojavaConvention.sourceSets.integrationTest.output.resourcesDirand the following code in mybuild.gradlefile:With this workaround in place, a
build/resources/integrationTest/test-dependenciesdirectory gets created and populated with${artifactId}.hpifiles and anindexfile that contains eachartifactId. This eliminated my issue with recent versions ofdurable-taskandworkflow-durable-task-step.I am hopeful that this issue will eventually be resolved upstream so that I can remove the workaround from my local build.
Just thought I’d mention the changes I managed to make to my build.gradle.kts which took care of this without extending
TestDependenciesTaskdirectly (and incase anyone wants a quick copy-paste solution to the problem).not that I condone using Kotlin.