jenkinsci / JenkinsPipelineUnit

Framework for unit testing Jenkins pipelines
MIT License
1.54k stars 394 forks source link

Callstacks should be loaded from classpath #229

Open jakub-bochenski opened 4 years ago

jakub-bochenski commented 4 years ago

All other JVM libraries I know of read resources using classpath. It's the JVM way of providing files. Reading resources from a hardcoded path is not portable and simply confusing.

The PR to change https://github.com/jenkinsci/JenkinsPipelineUnit/blob/master/src/main/groovy/com/lesfurets/jenkins/unit/RegressionTest.groovy#L5 to use ClassLoader.getResource should be trivial. I'm not sure about the consequences though. Probably there are some people who don't have src/test/resources added to source sets in their Gradle projects.

stchar commented 4 years ago

I'm not sure if regression tests are widely used, but I like your idea, would you like to submit a pull request?

jakub-bochenski commented 4 years ago

I will try and do this next time I do some changes in my Jenkinsfile scripts