Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests.job.CIPipelineTest > validate shell command[0] FAILED #19

Open
nishwalshetty opened this issue Jul 2, 2021 · 1 comment
Open

Comments

@nishwalshetty
Copy link

nishwalshetty commented Jul 2, 2021

sorry i am a noob with this frameowrk, any help in identifying the below issue is appreciated!

Unit Test cases fail with below error when three double quotes are used along with sh in Jenkinsfile

problem is when i use three double quotes without which i cannot get the value of groovy variable

Jenkinsfile Stage

stage('duration') {
steps{
withCredentials([string(credentialsId: 'GH_TOKEN', variable: 'GH_TOKEN'), usernamePassword(credentialsId: '', passwordVariable: 'dbpassword', usernameVariable: 'dbuser')]) {
script {
currentBuild.displayName = "$ghprbPullId"
sh """
echo ${currentBuild.durationString.replace(' and counting', '')} > duration.txt
cat duration.txt
"""
}
}
}
}

Error from Unit test case

tests.job.CIPipelineTest > validate the pipeline FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:18

tests.job.CIPipelineTest > validate shell command[0] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[1] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[2] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[3] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[4] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[5] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[6] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[7] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[8] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

tests.job.CIPipelineTest > validate shell command[9] FAILED
org.codehaus.groovy.control.MultipleCompilationErrorsException at CIPipelineTest.groovy:34

11 tests completed, 11 failed
:test FAILED

@nishwalshetty
Copy link
Author

@macg33zr can you help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant