You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running test1, I get the expected print: http://something, however, when mainFunc() calls helper(), I get an error message: No such property: env for class: helper
I understand that when running addEnvVar("BUILD_URL", "http://something") in test1, it adds env.BUILD_URL as a property to mainFunc's binding.
Is there anyway to make the env property truly global? Such that it would be accessible in helper's binding?
If it's not possible, can someone please explain how to mock helper.call?
Thank you
The text was updated successfully, but these errors were encountered:
If I have a jenkins shared library which looks like this for example:
└── project ├── src │ ├── helper.groovy │ └── mainFunc.groovy ├── test │ └── mainFuncTest.groovy └── vars └── myStep.groovy
src/helper.groovy
src/mainFunc.groovy:
vars/myStep.groovy
test/mainFuncTest.groovy:
When running test1, I get the expected print: http://something, however, when mainFunc() calls helper(), I get an error message:
No such property: env for class: helper
I understand that when running
addEnvVar("BUILD_URL", "http://something")
in test1, it addsenv.BUILD_URL
as a property to mainFunc's binding.Is there anyway to make the env property truly global? Such that it would be accessible in helper's binding?
If it's not possible, can someone please explain how to mock helper.call?
Thank you
The text was updated successfully, but these errors were encountered: