Skip to content

Commit

Permalink
fix(pipelines/pingcap/tidb): fix coverage data path and refactor unit…
Browse files Browse the repository at this point in the history
… job

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo committed Jul 19, 2023
1 parent f4269ed commit af86094
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions pipelines/pingcap/tidb/latest/ghpr_check2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ pipeline {
}
success {
dir("tidb") {
sh 'ls -alh test_coverage/ || true'
script {
prow.uploadCoverageToCodecov(REFS, 'integration', 'test_coverage/coverage.dat')
prow.uploadCoverageToCodecov(REFS, 'integration', './coverage.dat')
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pipeline {
}
}
stage('Test') {
environment { TIDB_CODECOV_TOKEN = credentials('codecov-token-tidb') }
environment { CODECOV_TOKEN = credentials('codecov-token-tidb') }
steps {
dir('tidb') {
sh '''#! /usr/bin/env bash
Expand All @@ -67,12 +67,9 @@ pipeline {
post {
success {
dir("tidb") {
sh label: "upload coverage to codecov", script: """
mv coverage.dat test_coverage/coverage.dat
wget -q -O codecov ${FILE_SERVER_URL}/download/cicd/tools/codecov-v0.5.0
chmod +x codecov
./codecov --flags unit --dir test_coverage/ --token ${TIDB_CODECOV_TOKEN} --pr ${REFS.pulls[0].number} --sha ${REFS.pulls[0].sha} --branch origin/pr/${REFS.pulls[0].number}
"""
script {
prow.uploadCoverageToCodecov(REFS, 'unit', './coverage.dat')
}
}
}
failure {
Expand Down

0 comments on commit af86094

Please sign in to comment.