Skip to content

Commit

Permalink
[CI][flaky] Support 7.x branches and PRs (elastic#22197)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 28, 2020
1 parent a18319d commit 6abf237
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 @@ -130,15 +130,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 6abf237

Please sign in to comment.