From cc7b21fba0a7784fecf4207d727f68d3f0751201 Mon Sep 17 00:00:00 2001 From: quicksilver Date: Wed, 15 Jan 2020 11:19:31 +0800 Subject: [PATCH] Flag the upload to group coverage metrics --- ci/jenkins/Jenkinsfile | 1 + ci/jenkins/step/coverage.groovy | 13 +++++++++---- codecov.yaml | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ci/jenkins/Jenkinsfile b/ci/jenkins/Jenkinsfile index ad2087f1..3495c75a 100644 --- a/ci/jenkins/Jenkinsfile +++ b/ci/jenkins/Jenkinsfile @@ -87,6 +87,7 @@ pipeline { steps { container("milvus-${BINARY_VERSION}-build-env") { script { + boolean isNightlyTest = isTimeTriggeredBuild() if ("${BINARY_VERSION}" == "gpu") { load "${env.WORKSPACE}/ci/jenkins/step/coverage.groovy" } else { diff --git a/ci/jenkins/step/coverage.groovy b/ci/jenkins/step/coverage.groovy index e159d388..281c4ef0 100644 --- a/ci/jenkins/step/coverage.groovy +++ b/ci/jenkins/step/coverage.groovy @@ -1,10 +1,15 @@ timeout(time: 30, unit: 'MINUTES') { dir ("ci/scripts") { sh "./coverage.sh -o ${env.MILVUS_INSTALL_PREFIX} -u root -p 123456 -t \$POD_IP" - // Set some env variables so codecov detection script works correctly - withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) { - sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest || echo \"Codecov did not collect coverage reports\"" - } + if (isNightlyTest) { + withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) { + sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest -F nightly -F ${BINARY_VERSION}-version-${OS_NAME}-unittest || echo \"Codecov did not collect coverage reports\"" + } + } else { + withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) { + sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest -F ${BINARY_VERSION}-version-${OS_NAME}-unittest || echo \"Codecov did not collect coverage reports\"" + } + } } } diff --git a/codecov.yaml b/codecov.yaml index c3fb95cd..2ddf708b 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -19,6 +19,10 @@ comment: behavior: default require_changes: no +flags: + nightly: + joined: false + ignore: - "LICENSES" - ".git" -- GitLab