On 19.10.2015 22:58, Paolo Di Tommaso wrote:
Dear all,

I'm getting a strange exception for both 2.3.X
<http://ci.groovy-lang.org/viewType.html?buildTypeId=JointBuilds_Nextflow_Groovy23xJointBuil>
and 2.4.X
<http://ci.groovy-lang.org/viewType.html?buildTypeId=JointBuilds_Nextflow_Groovy24xJointBuild>
 Groovy
joint builds for the nextflow project.

The exception reports the following stack trace:

    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
object 'Mock for type 'ISession'' with class 'com.sun.proxy.$Proxy39' to class 
'nextflow.Session'
         at nextflow.processor.PublishDir.createExecutor(PublishDir.groovy:298)
         at nextflow.processor.PublishDir.apply(PublishDir.groovy:192)
         at nextflow.processor.PublishDirTest.should copy output 
files(PublishDirTest.groovy:145)


The line throwing the error is at this link:

https://github.com/nextflow-io/nextflow/blob/master/src/main/groovy/nextflow/processor/PublishDir.groovy#L298

The problem is that I'm unable to replicate the issue on any of my usual
test environments (Mac/Oracle Java 7, Travis/Oracle Java 7 and 8,
CircleCI/OpenJDK 7)

I'm wondering if the problem can be related to any recent change to the
Groovy code base.

Nothing comes to my mind right now. Of course you could be more sure by using older Groovy versions.

Anyway, I don't know what kind of object is supposed to be stored in nextflow.Global.session, but from the trace I can make the assumption, that you are actually in testing (and your CI links confirm that) and that session has been mocked on basis of ISession. Now while Session is an ISession as well, doesn't mean that the mock would be a Session. Since the line has a type conversion using "as", I am wondering if some custom action is supposed to take place here. So much depends on how the mock was created...

but I did not look deep enough into to to conclude from the spock test in
https://github.com/nextflow-io/nextflow/blob/master/src/test/groovy/nextflow/processor/PublishDirTest.groovy#L145
to the actual mocking of Global.session

bye blackdrag


Reply via email to