-
Notifications
You must be signed in to change notification settings - Fork 77
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
Tests fail to run with Jenkins 2.357 and up #143
Comments
Worked around second error ( --- a/src/main/groovy/com/homeaway/devtools/jenkins/testing/JenkinsPipelineSpecification.groovy
+++ b/src/main/groovy/com/homeaway/devtools/jenkins/testing/JenkinsPipelineSpecification.groovy
@@ -606,6 +606,10 @@ public abstract class JenkinsPipelineSpecification extends Specification {
_objects.each { object ->
+ if( object.metaClass == null ) {
+ return;
+ }
+
final MetaMethod originalMethodMissing = object.metaClass.getMetaMethod("methodMissing", "string", new Object[0] )
object.metaClass.methodMissing = { String _name, _args -> With the above patch applied, still fails with the first error ( dependencies {
// ...
testImplementation 'cglib:cglib:3.2.9'
// ...
} |
In Groovy every class has a metaClass. But a class can obfuscate the call to metaClass if it has a method with this signature: The fix is not to check for a null, but to simply use |
I was able to workaround this issue by adding a Helper class to the test folder having a static initializer:
That adds a fake metaClass to the |
Expected Behavior
Test run with the most recent versions of
org.jenkins-ci.main:jenkins-core
package.Actual Behavior
When using
org.jenkins-ci.main:jenkins-core
version 2.356 and below, tests run as expected.When using
org.jenkins-ci.main:jenkins-core
version 2.357 up to 2.365, running tests produces an error for every test case:When using
org.jenkins-ci.main:jenkins-core
version 2.366 up to 2.395 (current latest), running tests produces an error for every test case:Steps to Reproduce
Current working dependencies (reduced from full set required for my project), bumping the version of
org.jenkins-ci.main:jenkins-core
leads to failures:Minimal failing test:
Additional Information
The text was updated successfully, but these errors were encountered: