web-dev-qa-db-fra.com

Erreur: "Arguments nommés attendus" en parallèle dans le script groovy Jenkins

J'ai un pipeline Jenkins 2.0, avec un groovyscript comme celui-ci:

node('nnh561.raijin') {
    stage 'checkout'
    build('trunk/checkout')

    stage 'build'
    parallel(
        { build('trunk/build/gfortran') },
        { build('trunk/build/ifort') }
    )

}

Chacun des travaux individuels se déroule correctement, mais lorsque j'essaie d'exécuter le pipeline, il crache cette erreur lorsqu'il atteint l'étape parallèle:

Java.lang.IllegalArgumentException: Expected named arguments but got [org.jenkinsci.plugins.workflow.cps.CpsClosure2@242d0d3a, org.jenkinsci.plugins.workflow.cps.CpsClosure2@9bf6d64]
    at org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.Java:275)
    at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.Java:110)
    at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.Java:113)
    at groovy.lang.GroovyObject$invokeMethod$0.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.Java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.Java:113)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.Java:151)
    at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.Java:21)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.Java:115)
    at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.Java:149)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.Java:146)
    at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.Java:123)
    at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.Java:15)
    at WorkflowScript.run(WorkflowScript:6)
    at ___cps.transform___(Native Method)
    at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.Java:55)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.Java:106)
    at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.Java:79)
    at Sun.reflect.GeneratedMethodAccessor294.invoke(Unknown Source)
    at Sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
    at Java.lang.reflect.Method.invoke(Method.Java:606)
    at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.Java:72)
    at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.Java:40)
    at com.cloudbees.groovy.cps.Next.step(Next.Java:58)
    at com.cloudbees.groovy.cps.Continuable.run0(Continuable.Java:154)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.Java:19)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.Java:33)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.Java:30)
    at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.Java:108)
    at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.Java:30)
    at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.Java:164)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.Java:277)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.Java:77)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.Java:186)
    at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.Java:184)
    at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.Java:47)
    at Java.util.concurrent.FutureTask.run(FutureTask.Java:262)
    at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.Java:112)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.Java:28)
    at Java.util.concurrent.Executors$RunnableAdapter.call(Executors.Java:471)
    at Java.util.concurrent.FutureTask.run(FutureTask.Java:262)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1145)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:615)
    at Java.lang.Thread.run(Thread.Java:745)
Finished: FAILURE

Des idées ce qui pourrait causer quelque chose comme ça?

16
naught101

Ahh ... le pipeline a besoin d'une carte, pas d'une liste. Nommer les arguments fonctionne:

node('nnh561.raijin') {
    stage 'checkout'{
    build('trunk/checkout')}

    stage 'build'
    parallel (
        'gfortran': { build('trunk/build/gfortran') },
        'ifort': { build('trunk/build/ifort') }
    )
}
33
naught101