Open jakub-bochenski opened 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.
I'm not sure if regression tests are widely used, but I like your idea, would you like to submit a pull request?
I will try and do this next time I do some changes in my Jenkinsfile scripts
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.