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

Add useJenkinsRule option for Test tasks #188

Open
sghill opened this issue Apr 15, 2021 · 0 comments
Open

Add useJenkinsRule option for Test tasks #188

sghill opened this issue Apr 15, 2021 · 0 comments

Comments

@sghill
Copy link

sghill commented Apr 15, 2021

The changes in 0.43.0 included removing the jenkins-war from the classpath and defining system properties to define where the war is and where it would be unpacked to. This is a nice step forward because it ensures that multiple tasks are not writing to the same output directory and no longer requires the war and all its dependencies to be on the classpath.

However plugins like the jira-trigger-plugin have defined additional test tasks that also need to use the Jenkins rule. That isn't very straightforward today:

def integTestDir = project.layout.buildDir.dir('jpi-plugin/integrationTest')
def jpiTest = new org.jenkinsci.gradle.plugins.testing.JpiTestingPlugin.Companion()

task integrationTest(type: Test) { Test t ->
    jpiTest.useJenkinsRule(t, integTestDir)
    t.testClassesDirs = sourceSets.integrationTest.output
    t.classpath = sourceSets.integrationTest.runtimeClasspath
    t.mustRunAfter test
}

Instead of this, it would be much nicer to infer the directory and not have to instantiate another class.

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

1 participant