mlasevich / jenkins-pipeline-library-reference Goto Github PK
View Code? Open in Web Editor NEWA Reference For Testable Jenkins Pipeline Library
A Reference For Testable Jenkins Pipeline Library
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;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.