mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-11-28 08:49:44 +02:00
fix groovy consumer test bugs (#696)
* Fix order so hash is set before notify * Always run tests on master branch
This commit is contained in:
parent
aca60b3ee6
commit
a4af238c95
@ -46,12 +46,6 @@ if (options.l) {
|
||||
}
|
||||
|
||||
if (!RUNNING_LOCALLY) {
|
||||
if (changeDoesNotNeedConsumerTesting()) {
|
||||
notifyGithub("success", "No consumer tests necessary.")
|
||||
println 'No consumer tests necessary.'
|
||||
return
|
||||
}
|
||||
|
||||
/*
|
||||
In case the build is performed for a pull request TRAVIS_COMMIT is a merge
|
||||
commit between the base branch and the PR branch HEAD. That commit is actually built.
|
||||
@ -65,7 +59,13 @@ if (!RUNNING_LOCALLY) {
|
||||
*/
|
||||
COMMIT_HASH = System.getenv('TRAVIS_PULL_REQUEST_SHA') ?: System.getenv('TRAVIS_COMMIT')
|
||||
|
||||
notifyGithub("pending", "Consumer tests are in progress.")
|
||||
if (changeDoesNotNeedConsumerTesting()) {
|
||||
println 'No consumer tests necessary.'
|
||||
notifyGithub("success", "No consumer tests necessary.")
|
||||
return
|
||||
} else {
|
||||
notifyGithub("pending", "Consumer tests are in progress.")
|
||||
}
|
||||
}
|
||||
|
||||
if (!System.getenv('CX_INFRA_IT_CF_USERNAME') || !System.getenv('CX_INFRA_IT_CF_PASSWORD')) {
|
||||
@ -195,6 +195,10 @@ def notifyGithub(state, description) {
|
||||
}
|
||||
|
||||
def changeDoesNotNeedConsumerTesting() {
|
||||
if (System.getenv('TRAVIS_BRANCH') == 'master') {
|
||||
return false
|
||||
}
|
||||
|
||||
def excludesRegex = '(' + EXCLUDED_FROM_CONSUMER_TESTING_REGEXES.join('|') + ')'
|
||||
|
||||
"git remote add sap https://github.com/SAP/jenkins-library.git".execute().waitFor()
|
||||
|
Loading…
Reference in New Issue
Block a user