Skip to content

Commit

Permalink
[CI][flaky] Support 7.x branches and PRs (#22197)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 28, 2020
1 parent 36775b2 commit 577c25b
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,41 @@ pipeline {
cleanup {
// Required to enable the flaky test reporting with GitHub. Workspace exists since the post/always runs earlier
dir("${BASE_DIR}"){
// TODO analyzeFlakey does not support other release branches but the master branch.
notifyBuildResult(prComment: true,
slackComment: true, slackNotify: (isBranch() || isTag()),
analyzeFlakey: true, flakyReportIdx: "reporter-beats-beats-master")
analyzeFlakey: !isTag(), flakyReportIdx: "reporter-beats-beats-${getIdSuffix()}")
}
}
}
}

/**
* There are only two supported branches, master and 7.x
*/
def getIdSuffix() {
if(isPR()) {
return getBranchIndice(env.CHANGE_TARGET)
}
if(isBranch()) {
return getBranchIndice(env.BRANCH_NAME)
}
}

/**
* There are only two supported branches, master and 7.x
*/
def getBranchIndice(String compare) {
if (compare?.equals('master') || compare.equals('7.x')) {
return compare
} else {
if (compare.startsWith('7.')) {
return '7.x'
}
}
return 'master'
}


/**
* This method is the one used for running the parallel stages, therefore
* its arguments are passed by the beatsStages step.
Expand Down

0 comments on commit 577c25b

Please sign in to comment.