I would like to write some tests for pipeline scripts. Has anyone created a mock pipeline implementation. Development of pipeline script unit tests is pretty convoluted when you have to run the test in jenkins. I am looking for something that allows me to use replacements for existing pipeline steps so there is no source level change between tests and the deployed code. I understand how to replace annotations in Groovy. However trying to replace something like this at runtime has proven to be a challenge. I want to provide my own node closure and my own git method. Is there some kind of interface for all the pipeline support that I can include on my test class path?
node("master") {
}
I want to write a test that verifies this code so I need to replace node and git.
Has anyone looked tried something similar?
Of course I could create a local instance and run tests in my local test instance and that is the answer.