Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Correct PR branch detection in code coverage #12615

Merged
merged 5 commits into from
Sep 21, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ci/Jenkinsfile_utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ echo ${libs} | sed -e 's/,/ /g' | xargs md5sum
def publish_test_coverage() {
// CodeCovs auto detection has trouble with our CIs PR validation due the merging strategy
def codecovArgs = ""
if (env.CHANGE_ID != '') {
GIT_COMMIT_HASH = sh (script: "git rev-parse @", returnStdout: true)
if (env.CHANGE_ID) {
// PR execution
// Take the previous commit because of our PR merge strategy that adds a temporary commit for CI
GIT_COMMIT_HASH = sh (script: "git rev-parse @~", returnStdout: true)
codecovArgs += "-B ${env.CHANGE_TARGET} " +
"-C ${GIT_COMMIT_HASH} " +
"-P ${env.CHANGE_ID} "
} else {
// Branch execution
GIT_COMMIT_HASH = sh (script: "git rev-parse @", returnStdout: true)
codecovArgs += "-B ${env.BRANCH_NAME} " +
"-C ${GIT_COMMIT_HASH} "
}
Expand Down