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
[ERROR] can run methods in helper scripts whose names create invalid JVM class names from other methods in those scripts(com.homeaway.devtools.jenkins.testing.scripts.InvalidClassNameSpec) Time elapsed: 0.043 s <<< ERROR!
java.lang.ClassFormatError: Illegal class name "some-helper-script$internal_method" in class file some-helper-script$internal_method
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at some-helper-script.composed_method(some-helper-script.groovy:27)
at com.homeaway.devtools.jenkins.testing.InvalidlyNamedScriptWrapper.invokeMethod(InvalidlyNamedScriptWrapper.groovy:68)
at com.homeaway.devtools.jenkins.testing.scripts.InvalidClassNameSpec.can run methods in helper scripts whose names create invalid JVM class names from other methods in those scripts(InvalidClassNameSpec.groovy:96)
This may just mean that the "invalid class name" handling needs to be improved.
This may be symptomatic of the script-loading mechanism being used incorrectly and may warrant looking into alternate implementations for this snippet:
Expected Behavior
Given a script with an invalid JVM name, like
some-script.groovy
, and contents with multiple methods:I would expect to be able to call method
two()
during a test, like this:Actual Behavior
The fact that
some-script.groovy
is compiled to a class file whose name is not valid to a JVM is a problem. Branch https://github.com/ExpediaGroup/jenkins-spock/tree/invalid-name-internal adds a unit test; the output isSteps to Reproduce
See the unit tests added in branch https://github.com/ExpediaGroup/jenkins-spock/tree/invalid-name-internal
Additional Information
This may just mean that the "invalid class name" handling needs to be improved.
This may be symptomatic of the script-loading mechanism being used incorrectly and may warrant looking into alternate implementations for this snippet:
jenkins-spock/src/main/groovy/com/homeaway/devtools/jenkins/testing/JenkinsPipelineSpecification.groovy
Lines 886 to 911 in c864e4e
We should investigate and if it can be solved with the Wrapper, make sure that N & N+1 layers of nesting are solved, too.
The text was updated successfully, but these errors were encountered: