From af860942a5b6585c08042940ad289dcb49c35e8d Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Wed, 19 Jul 2023 16:20:36 +0800 Subject: [PATCH] fix(pipelines/pingcap/tidb): fix coverage data path and refactor unit job Signed-off-by: wuhuizuo --- pipelines/pingcap/tidb/latest/ghpr_check2.groovy | 3 +-- pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pipelines/pingcap/tidb/latest/ghpr_check2.groovy b/pipelines/pingcap/tidb/latest/ghpr_check2.groovy index 3fd9baf2f..cd133e208 100644 --- a/pipelines/pingcap/tidb/latest/ghpr_check2.groovy +++ b/pipelines/pingcap/tidb/latest/ghpr_check2.groovy @@ -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') } } } diff --git a/pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy b/pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy index 70e649422..300fdd6ed 100644 --- a/pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy +++ b/pipelines/pingcap/tidb/latest/ghpr_unit_test.groovy @@ -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 @@ -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 {