I am writing Jenkins pipeline and my pipeline is quite big hence for testing purpose I create small one with new code that I add and want to test.
After testing that code in small testing pipeline, I copy/paste that code in original big pipeline. And when run big pipeline, after running for hours, it fails with trivial causes like variable is not defined which was missed during copy/paste from testing pipeline.
These kind of trivial errors are identified neither in Jenkins Pipeline UI nor in Intellij Idea(which I use)
Could someone please help me how these kind of trivial mistakes can be avoided so that pipeline after running long time does not fail?