On Sunday, April 7, 2019 at 10:10:07 PM UTC+2, Sverre Moe wrote:

Is it possible to create unit tests for our scripted pipeline?
>
> How can certain sections of the pipeline be mocked, like fetching from 
> Git, tagging to Git, Uploading to Nexus?
>
> Anyone been able to fully unit test scripted pipeline?
>
> I found this project at GitHub regarding Unit testing pipelines.
> https://github.com/jenkinsci/JenkinsPipelineUnit
>

I'm using this right now and it works well. Out of the box, several 
commands are not mocked (build, withMaven, etc) but it's simple to do so 
(usually just one line).

withMaven() is a bit more complex to write to make sure the bindings are 
correct. See https://github.com/jenkinsci/JenkinsPipelineUnit/issues/140

Regards,

-- 
Aaron Digulla
 

-- 
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/30c1a1f3-43a6-47fe-9bdb-b639954d4130%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to