Re: Pipeline: Hos to test them locally

2016-12-25 Thread Torsten Reinhard
Hi, 

we were also wondering why there´s that pipeline-as-code approach available 
and strongly recommended everywhere - without any traditional support 
(automated tests) of developing clean code for it.

So we worked around that by doing the following:
- we have a Test Jenkins instance running where the pipeline code is tested 
first. pushes or released versions only go to productive Jenkins if well 
tested
- we "mocked" the pipeline DSL methods which enables us to at least do some 
basic groovy syntax and compilation tests. So far, Mockito, JUnit, Spock 
helps us a little.
- we developed some simple "integration-test" pipelines where we can test 
the pipeline code first - before testing or using it with real-life 
projects.

It´s currently a time-consuming and sometimes frustrating process to get 
things running - but we are looking forward to a lot of improvements coming 
soon.

Good luck, 

Torsten

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/df090766-3ba2-4e19-af8f-a57b5f97256c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline: Hos to test them locally

2016-12-12 Thread Peter McNab
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 = '
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 
> 
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 jenkinsci-users+unsubscr...@googlegroups.com
.
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 jenkinsci-users+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com 
.

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 jenkinsci-users+unsubscr...@googlegroups.com.
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.


Re: Pipeline: Hos to test them locally

2016-12-11 Thread Victor Martinez
I'll follow that jira ticket then. Thanks Michael

On Saturday, 10 December 2016 18:00:10 UTC, 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  > 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 jenkinsci-use...@googlegroups.com .
>> 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ffbacbcc-a6db-4b52-966a-df8d0a0b88e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline: Hos to test them locally

2016-12-10 Thread Michael Kobit
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 <
victormartinezru...@gmail.com> 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 jenkinsci-users+unsubscr...@googlegroups.com.
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALELY9HHZ1wnJq6fvXgBS5DZGxTjMRZo%2B_PxpRZNQDHBJ5ubsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline: Hos to test them locally

2016-12-08 Thread Victor Martinez
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 jenkinsci-users+unsubscr...@googlegroups.com.
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.