Code Monkey home page Code Monkey logo

jenkins-pipeline-library-reference's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jimklimov

jenkins-pipeline-library-reference's Issues

non cps method calling cps method does not throw CpsCallableInvocation as expected

Hi,

identifying cps issues during development is critical to jenkins pipeline development. I am glad you are attempting to address it here. I am challenged with the same. I was trying to factor your repo to detect issues that you would normally see only when run on Jenkins i.e with cps transformation. For instance "a non cps method will fail in jenkins when it calls a cps transformed method". But I was not able to test that scenarios successfully with your implementation. I do not have insight into internal groovy:cps implementation or haven't attempted that yet. Can you help me figure out why the following test case fails. shouldn't it throw CpsCallableInvocation. The same script fails with expected to call WorkflowScript.nonCpsMethodCallingCpsMethod but wound up catching WorkflowScript.cpsMethod; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/ when run on jenkins.

This test does NOT throw CpsCallableInvocation as expected. This test case fails

def "ascpsscript"(){
        when:
        asCPSScript("""

import com.cloudbees.groovy.cps.NonCPS
                @ NonCPS
        public void nonCpsMethodCallingCpsMethod(){
            println "this is a non cps method"
            cpsMethod()
        }
        public void cpsMethodCallingNonCps(){
            println "this is a cps method calling non cps method"
            nonCpsMethodCallingCpsMethod()
            println "after:this is a cps method calling non cps method"
        }
        public void cpsMethod(){
            println "this is a cps method"
        }
        @NonCPS
        public nonCpsMethod(){
            println "this is a non cps method"
        }
        nonCpsMethodCallingCpsMethod()
        """)
        then:
        thrown CpsCallableInvocation;
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.