-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groovy code has different behavior between Jenkins and test execution #79
Comments
I believe that Jenkins is actually wrong here. Jenkins has had trouble for a while with supporting Groovy-style iterative blocks in Jenkins' CPS-transformed pipeline script engine. Jenkins-Spock does not apply the CPS transformation that Jenkins does, so there are some idiosyncrasies that Jenkins might exhibit that will not show up in Jenkins-Spock. You should think of Jenkins-Spock as a way to unit-test your Jenkins Pipeline code for correct input/output, not as a way to test a Jenkins Pipeline's runtime behavior. There are other tools (like jenkinsfilerunner) if you want to "actually" run a pipeline in Jenkins as a "test." Which version of Jenkins are you using? I cannot reproduce this issue with the current version of jenkins-spock in the Is your Jenkins environment up-to-date? |
@awittha thanks a lot for the explanation. |
Ah, those are the versions in your |
Expected Behavior
I have a groovy piece of code (and it's not the only case) where the behavior is different for test and Jenkins execution
I have all Jenkins instance plugins added as dependency in my project but I can reproduce it in tests.
The code is
The jenkins output is
I know I can replace code by
['a', 'b'].each { println(it) }
but make me wonder how accurate the tests are.Actual Behavior
The code is working in tests but in Jenkins
The text was updated successfully, but these errors were encountered: