You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding the ghprb plugin, tests fail regarding closures.
Using the example job from ghprb-plugin page
job('upstreamJob') {
scm {
git {
remote {
github('test-owner/test-project')
refspec('+refs/pull/*:refs/remotes/origin/pr/*')
}
branch('${sha1}')
}
}
triggers {
githubPullRequest {
admin('user_1')
admins(['user_2', 'user_3'])
userWhitelist('you@you.com')
userWhitelist(['me@me.com', 'they@they.com'])
orgWhitelist('my_github_org')
orgWhitelist(['your_github_org', 'another_org'])
cron('H/5 * * * *')
triggerPhrase('OK to test')
onlyTriggerPhrase()
useGitHubHooks()
permitAll()
autoCloseFailedPullRequests()
displayBuildErrorsOnDownstreamBuilds()
whiteListTargetBranches(['master','test', 'test2'])
blackListTargetBranches(['master','test', 'test2'])
allowMembersOfWhitelistedOrgsAsAdmin()
extensions {
commitStatus {
context('deploy to staging site')
triggeredStatus('starting deployment to staging site...')
startedStatus('deploying to staging site...')
addTestResults(true)
statusUrl('http://mystatussite.com/prs')
completedStatus('SUCCESS', 'All is well')
completedStatus('FAILURE', 'Something went wrong. Investigate!')
completedStatus('PENDING', 'still in progress...')
completedStatus('ERROR', 'Something went really wrong. Investigate!')
}
buildStatus {
completedStatus('SUCCESS', 'There were no errors, go have a cup of coffee...')
completedStatus('FAILURE', 'There were errors, for info, please see...')
completedStatus('ERROR', 'There was an error in the infrastructure, please contact...')
}
}
}
}
publishers {
mergeGithubPullRequest {
mergeComment('merged by Jenkins')
onlyAdminsMerge()
disallowOwnCode()
failOnNonMerge()
deleteOnMerge()
}
}
}
job('downstreamJob') {
wrappers {
downstreamCommitStatus {
context('CONTEXT NAME')
triggeredStatus("The job has triggered")
startedStatus("The job has started")
statusUrl()
completedStatus('SUCCESS', "The job has passed")
completedStatus('FAILURE', "The job has failed")
completedStatus('ERROR', "The job has resulted in an error")
}
}
}
The error I see when running gradle clean build via a jenkins verify job:
Expected no exception to be thrown, but got 'javaposse.jobdsl.dsl.DslScriptException'
at spock.lang.Specification.noExceptionThrown(Specification.java:118)
at com.target.JobScriptsSpec.test script #file.name(JobScriptsSpec.groovy:45)
Caused by:
javaposse.jobdsl.dsl.DslScriptException: (CookbookPullRequest.groovy, line 48) No signature of method: javaposse.jobdsl.dsl.helpers.triggers.TriggerContext.githubPullRequest() is applicable for argument types: (com.target.CookbookPullRequest$_build_closure1$_closure4$_closure11) values: [com.target.CookbookPullRequest$_build_closure1$_closure4$_closure11@5ec0416e]
at javaposse.jobdsl.dsl.DslScriptLoader.runScriptEngine(DslScriptLoader.groovy:135)
at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader_closure1(DslScriptLoader.groovy:78)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at javaposse.jobdsl.dsl.DslScriptLoader.runScriptsWithClassLoader(DslScriptLoader.groovy:68)
at javaposse.jobdsl.dsl.DslScriptLoader.runScripts(DslScriptLoader.groovy:44)
at javaposse.jobdsl.dsl.DslScriptLoader.runScript(DslScriptLoader.groovy:58)
at com.target.JobScriptsSpec.test script #file.name(JobScriptsSpec.groovy:41)
Caused by:
groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.dsl.helpers.triggers.TriggerContext.githubPullRequest() is applicable for argument types: (com.target.CookbookPullRequest$_build_closure1$_closure4$_closure11) values: [com.target.CookbookPullRequest$_build_closure1$_closure4$_closure11@5ec0416e]
at javaposse.jobdsl.dsl.AbstractExtensibleContext.methodMissing(AbstractExtensibleContext.groovy:19)
at com.target.CookbookPullRequest.build_closure1$_closure4(CookbookPullRequest.groovy:48)
at com.target.CookbookPullRequest.build_closure1$_closure4(CookbookPullRequest.groovy)
at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16)
at javaposse.jobdsl.dsl.Job.triggers(Job.groovy:568)
at com.target.CookbookPullRequest.build_closure1(CookbookPullRequest.groovy:47)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at javaposse.jobdsl.dsl.JobParent.processItem(JobParent.groovy:136)
at javaposse.jobdsl.dsl.JobParent.freeStyleJob(JobParent.groovy:46)
at javaposse.jobdsl.dsl.JobParent.job(JobParent.groovy:38)
at com.target.CookbookPullRequest.build(CookbookPullRequest.groovy:27)
at script.run(script:13)
at javaposse.jobdsl.dsl.DslScriptLoader.runScriptEngine(DslScriptLoader.groovy:129)
... 7 more
When I run ./gradle clean build locally though, I see no errors. It seems to be something that only happens when run on a jenkins slave.
The text was updated successfully, but these errors were encountered:
When adding the ghprb plugin, tests fail regarding closures.
Using the example job from ghprb-plugin page
The error I see when running
gradle clean build
via a jenkins verify job:When I run
./gradle clean build
locally though, I see no errors. It seems to be something that only happens when run on a jenkins slave.The text was updated successfully, but these errors were encountered: