The (far from perfect) method we've been using is to use a "testing"
pipeline job. Rather than fetching the project from source, it is an
explicit script that uses a "load" to load in the "real" pipeline script
from my development environment (which is available via NFS).
sourcepath = <PATH TO MY SRC DIR>'
node('master') {
load "${sourcepath}/Jenkinsfile"
}
That allows me to just save locally and run the job.
Even better, I can then run the job using the jenkins-cli.jar and see
the output in my shell which removes the need to interact with the
jenkins UI altogether.
java -jar jenkins-cli.jar -s $JENKINS_URL build $JOB_NAME -s -v
Of course you have to be disciplined about checking in WIP and making
sure that all files your pipeline is trying to use checked in
eventually, and there are some cases where the above method acts a
little differently than when pulling from SCM. Also be sure to check
"Use Groovy Sandbox" since pipeline scripts coming from SCM have that set.
Pete
On 12/10/2016 9:59 AM, Michael Kobit wrote:
You can use the "Replay" option, which might help you iterate a little
bit faster. There isn't really a good way to test and validate that
your pipeline is correct other than just running it.
https://issues.jenkins-ci.org/browse/JENKINS-33925 is open for a test
framework for Jenkinsfile.
On Fri, Dec 9, 2016 at 1:20 AM Victor Martinez
<[email protected] <mailto:[email protected]>>
wrote:
Hi there,
Just wondering if there is any new supported feature of testing
Jenkinsfile, aka pipelines, locally, if so, where can i find some
examples/docs? I want to get rid of the manual and tedious process
of pushing changes to my repo then look at the jebkibs job andsee
whether it does what i coded. I'd like to speed up my development
with lets say some TDD. If no, will it be supported in the near
future? Or it doesnt make sense?
Thanks guys
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected]
<mailto:jenkinsci-users%[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/c6122b07-85f3-407b-8e81-ae23651e0b27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com
<https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Peter McNab | Engineering Tools Tech Lead
T: +1 510-473-3124 | M: +1 408-203-7114
http://www.perforce.com
--
You received this message because you are subscribed to the Google Groups "Jenkins
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/584EDC1C.4080604%40perforce.com.
For more options, visit https://groups.google.com/d/optout.