As of v3.60.0 preloading groovy file from script library breaks cross referencing
My situation: I have a big script library with multiple groovy files. I have for instance "groovyScriptA.groovy" which has methods "ScriptA1()", "ScriptA2()" and "ScriptA3()'. Another script library file is "groovyScriptB.groovy" which has methods "ScriptB1()" and "ScriptB2()".
In method "scriptA3()" I make use of the method "scriptB2()". This was never a problem...until ReadyApi released version 3.60.0. There I've noticed there is a new feature, which does some preloading of the script library.
In logs from 3.60.0 & 3.61.0 I can see:
13:14:34,777 INFO [SoapUIProGroovyScriptEngineFactory] Adding Script Library at [/var/jenkins_agent_home/workspace/ci-jobs/abc/xyz/abc-readyapi-project/scripts]
13:14:34,777 INFO [SoapUIProGroovyScriptEngineFactory] Preloading groovy file: groovyScriptA.groovy
13:14:34,790 ERROR: Error preloading groovy file: /var/jenkins_agent_home/workspace/ci-jobs/abc/xyz/abc-readyapi-project/scripts/groovyScriptA.groovy
ReadyAPI logs a compilation error during this preloading:: "unable to resolve class scriptB2". When I have it locally, I can refresh the project and then the error no longer shows, all script library files are properly loaded. But in the build pipeline the error is encountered and all my tests relying on the script library groovyScriptA.groovy will fail. From what I can tell, it's also intermittently. I guess sometimes the sequence of preloading changes, so when "groovyScriptB.groovy" is preloaded before "groovyScriptA.groovy" then the error does not show.
What I tried:
- an "import groovyScriptB" in "groovyScriptA.groovy"
- an "import groovyScriptB" in "groovyScriptA.groovy" together with defining package
- renaming the class names to best practice upper casing
- making sure I have "groovyScriptB.groovy" saved as last so that the it would preload the most recent first
Unfortunately, nothing makes cross-referencing methods work again. We had to revert back to v3.59.0. I hoped this breaking change was detect by SmartBear and fixed in v3.61.0, but I can confirm it's still there. I will also log a SmartBear customer care support ticket = Case #00737901.
Note that in the logs from v3.59.0 there is no sign of this "Preloading groovy file". There it consistently works fine.
Example v3.59.0 logs:
17:30:23,763 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [/home/jenkins/scripts]
17:30:23,763 INFO [SoapUIProGroovyScriptEngineFactory] Resetting groovy class cache due to 11 modified files
17:30:23,764 INFO [SoapUIProGroovyScriptEngineFactory] Adding Script Library at [/var/jenkins_agent_home/workspace/ci-jobs/abc/xyz/abc-readyapi-project/scripts]