Skip to content

Commit

Permalink
pipelines/ci/tidb: upload coverage for br and dumpling (#497)
Browse files Browse the repository at this point in the history
* pipelines/ci/tidb: upload coverage for br and dumpling

* fix upload path

* fix: correct shell script

Co-authored-by: Lifu Wu <[email protected]>
  • Loading branch information
tangenta and purelind authored Dec 7, 2021
1 parent 2ffbd9c commit 1b5c18f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions jenkins/pipelines/ci/tidb/tidb_ghpr_coverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,27 @@ try {
def tidb_path = "${ws}/go/src/github.com/pingcap/tidb"
dir("go/src/github.com/pingcap/tidb") {
container("golang") {
sh "make gotest"
sh """
make br_unit_test
mv coverage.txt br.coverage
make dumpling_unit_test
mv coverage.txt dumpling.coverage
make gotest
mv coverage.txt tidb.coverage
"""
withCredentials([string(credentialsId: 'codecov-token-tidb', variable: 'CODECOV_TOKEN')]) {
timeout(30) {
if (ghprbPullId != null && ghprbPullId != "") {
sh """
curl -LO ${FILE_SERVER_URL}/download/cicd/ci-tools/codecov
chmod +x codecov
./codecov -f coverage.txt -t ${CODECOV_TOKEN} -C ${ghprbActualCommit} -P ${ghprbPullId} -b ${BUILD_NUMBER}
./codecov -f "tidb.coverage" -f "br.coverage" -f "dumpling.coverage" -t ${CODECOV_TOKEN} -C ${ghprbActualCommit} -P ${ghprbPullId} -b ${BUILD_NUMBER}
"""
} else {
sh """
curl -LO ${FILE_SERVER_URL}/download/cicd/ci-tools/codecov
chmod +x codecov
./codecov -f coverage.txt -t ${CODECOV_TOKEN} -C ${ghprbActualCommit} -b ${BUILD_NUMBER} -B ${ghprbTargetBranch}
./codecov -f "tidb.coverage" -f "br.coverage" -f "dumpling.coverage" -t ${CODECOV_TOKEN} -C ${ghprbActualCommit} -b ${BUILD_NUMBER} -B ${ghprbTargetBranch}
"""
}
}
Expand Down Expand Up @@ -190,4 +197,4 @@ if (params.containsKey("triggered_by_upstream_ci")) {
build(job: "tidb_update_commit_status", parameters: default_params, wait: true)
}
}
}
}

0 comments on commit 1b5c18f

Please sign in to comment.