[
https://issues.apache.org/jira/browse/CASSANDRA-15496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17018344#comment-17018344
]
David Capwell commented on CASSANDRA-15496:
-------------------------------------------
Ok, took a stab at reuse using the function and got something working. Turns
out the pipeline DSL is very restrictive and doesn't allow arbitrary groovy.
The Node syntax is pure groovy so able to
{code}
def targets = ['stress-test', 'fqltoolt']
node {
stage('Init') {
cleanWs()
}
stage('Test') {
parallel targets.collectEntries {
["Build ${it}" : runBuild(it)]
}
}
}
def runBuild(target) {
return {
stage(target) {
warnError('Tests unstable') {
build job: "${env.JOB_NAME}-$target"
}
warnError('missing test xml files') {
script {
step ([$class: 'CopyArtifact',
projectName: "${env.JOB_NAME}-$target",
optional: true,
fingerprintArtifacts: true,
selector: [$class: 'StatusBuildSelector', stable:
false],
target: target])
}
unstable {
warnError('missing test xml files') {
script {
step ([$class: 'CopyArtifact',
projectName: "${env.JOB_NAME}-$target",
optional: true,
fingerprintArtifacts: true,
selector: [$class: 'StatusBuildSelector', stable:
false],
target: $target])
}
}
}
}
}
}
}
{code}
> Declarative Jenkins pipeline builds (and removing `ant test-all`)
> -----------------------------------------------------------------
>
> Key: CASSANDRA-15496
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15496
> Project: Cassandra
> Issue Type: Task
> Components: Test/unit
> Reporter: Michael Semb Wever
> Assignee: Michael Semb Wever
> Priority: Normal
> Fix For: 2.2.x, 3.0.x, 3.11.x, 4.x
>
> Attachments: Screenshot 2020-01-17 at 21.14.52.png, Screenshot
> 2020-01-17 at 21.16.05.png, Screenshot 2020-01-17 at 21.16.47.png, Screenshot
> 2020-01-17 at 21.18.49.png
>
>
> *Declarative Jenkins pipeline*
> Currently all the jenkins build jobs are generated by the DSL job from the
> cassandra-builds repository.
> For a given branch, there are numerous builds: artifacts, unit tests, and
> dtests.
> Using a (declarative) {{Jenkinsfile}} in-tree these builds can be put
> together into per-branch pipelines.
> Per-branch pipelines will give a nicer UI (via blue ocean) and one place to
> look at test results for any branch and commit. From there we can post one
> complete test summary on commits back to the related jira ticket.
> ref:
> https://lists.apache.org/thread.html/rc8d5a55142ea3bfb742e3347b8ea924946796bad03a1e089c8fb9ee7%40%3Cdev.cassandra.apache.org%3E
> *Removing {{`ant test-all`}}*
> Currently the test-all target does nothing but execute the test target.
> This is because the test targets finishes with unit test failures.
> As these jenkins jobs are automated here:
> https://github.com/apache/cassandra-builds/blob/master/jenkins-dsl/cassandra_job_dsl_seed.groovy#L44
> ; it is easy enough to remove the "test-all" target, replacing it with
> separate jobs for 'stress-test', 'fqltool-test', and 'long-test'.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]