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

Add correct test coverage branch detection #12551

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Changes from all 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
19 changes: 18 additions & 1 deletion ci/Jenkinsfile_utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,25 @@ 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 != '') {
// 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} "
}

// To make sure we never fail because test coverage reporting is not available
// Fall back to our own copy of the bash helper if it failed to download the public version
sh '(curl --retry 10 -s https://codecov.io/bash | bash -s -) || (curl --retry 10 -s https://s3-us-west-2.amazonaws.com/mxnet-ci-prod-slave-data/codecov-bash.txt | bash -s -)'
sh "(curl --retry 10 -s https://codecov.io/bash | bash -s - ${codecovArgs}) || (curl --retry 10 -s https://s3-us-west-2.amazonaws.com/mxnet-ci-prod-slave-data/codecov-bash.txt | bash -s - ${codecovArgs}) || true"
}

def collect_test_results_unix(original_file_name, new_file_name) {
Expand Down