DEV Community

Discussion on: How-To: Setup a unit-testable Jenkins shared pipeline library

Collapse
 
haridsv profile image
Haridsv

Great guide! Have you tried getting code coverage numbers for the vars files?

Collapse
 
haridsv profile image
Haridsv

I guess it doesn't matter in this approach, since the var files don't really have much logic, but curious nevertheless.

Collapse
 
kuperadrian profile image
Adrian Kuper

Yeah, I'm not to sure about how to test groovy scripts in general, but testing anything in vars can be tough when Jenkins steps like sh are used. So as you said, the general approach here is to keep the code inside vars as small and trivial as possible while testing can be done for "conventional" classes. Therefore I don't have any code coverage numbers for the vars stuff