We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
The text was updated successfully, but these errors were encountered:
@macg33zr can you help ?
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: