Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix ci covprofile by updating codecov version and replacing cover pkg #8044

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pd-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
TOTAL_JOBS: ${{needs.chunks.outputs.job-total}}
run: for i in $(seq 1 $TOTAL_JOBS); do cat covprofile_$i >> covprofile; done
- name: Send coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4.2.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error is

https://codecov.io/upload/v4?package=github-action-v1.5.2-1.0.3&token=secret&branch=improve-linter&commit=9f34462e696c925657636f437c894bad31fac16e&build=8586757005&build_url=http%3A%2F%2Fgithub.com%2Ftikv%2Fpd%2Factions%2Fruns%2F8586757005&name=codecov-umbrella&tag=&slug=tikv%2Fpd&service=github-actions&flags=unittests&pr=8015&job=PD+Test&cmd_args=n,F,Q,f,C
{'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

need to update codecov version ref codecov/codecov-action#557

can check more information in https://github.com/tikv/pd/actions/runs/8586757005/job/23529728059?pr=8015

with:
token: ${{ secrets.CODECOV }}
file: ./covprofile
Expand Down
6 changes: 3 additions & 3 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
# limitations under the License.

ROOT_PATH := $(shell pwd)/..
GO_TOOLS_BIN_PATH := $(shell pwd)/../.tools/bin
GO_TOOLS_BIN_PATH := $(ROOT_PATH)/.tools/bin
PATH := $(GO_TOOLS_BIN_PATH):$(PATH)
SHELL := env PATH='$(PATH)' GOBIN='$(GO_TOOLS_BIN_PATH)' $(shell which bash)

default: static tidy test

test: failpoint-enable
CGO_ENABLE=1 go test ./... -v -tags deadlock -race -cover || { $(MAKE) failpoint-disable && exit 1; }
CGO_ENABLED=1 go test ./... -v -tags deadlock -race -cover || { $(MAKE) failpoint-disable && exit 1; }
$(MAKE) failpoint-disable

basic-test: failpoint-enable
CGO_ENABLE=1 go test ./... || { $(MAKE) failpoint-disable && exit 1; }
CGO_ENABLED=1 go test ./... || { $(MAKE) failpoint-disable && exit 1; }
$(MAKE) failpoint-disable

ci-test-job:
Expand Down
6 changes: 3 additions & 3 deletions scripts/ci-subtask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ if [[ $2 -gt 9 ]]; then
fi

# Currently, we only have 3 integration tests, so we can hardcode the task index.
integrations_dir=./tests/integrations
integrations_dir=$(pwd)/tests/integrations
integrations_tasks=($(find "$integrations_dir" -mindepth 1 -maxdepth 1 -type d))
for t in "${integrations_tasks[@]}"; do
if [[ "$t" = "$integrations_dir/client" && $2 -eq 11 ]]; then
cd ./client && make ci-test-job && cat covprofile >> $ROOT_PATH_COV && cd .. || exit 1
cd ./client && make ci-test-job && cat covprofile >> $ROOT_PATH_COV || exit 1
cd $integrations_dir && make ci-test-job test_name=client && cat ./client/covprofile >> $ROOT_PATH_COV || exit 1
elif [[ "$t" = "$integrations_dir/tso" && $2 -eq 12 ]]; then
cd $integrations_dir && make ci-test-job test_name=tso && cat ./tso/covprofile >> $ROOT_PATH_COV || exit 1
Expand Down Expand Up @@ -61,5 +61,5 @@ else
[[ $(($min_i + 1)) -eq $2 ]] && res+=($t)
done

CGO_ENABLED=1 go test -timeout=15m -tags deadlock -race -covermode=atomic -coverprofile=$ROOT_PATH_COV -coverpkg=./... ${res[@]}
CGO_ENABLED=1 go test -timeout=15m -tags deadlock -race -cover -covermode=atomic -coverprofile=$ROOT_PATH_COV -coverpkg=./... ${res[@]}
fi
4 changes: 2 additions & 2 deletions tests/integrations/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ test: failpoint-enable
$(MAKE) failpoint-disable

ci-test-job:
if [ -f covprofile ]; then rm ./$(value test_name)/covprofile; fi
CGO_ENABLED=1 go test ./$(value test_name)/... -v -tags deadlock -race -cover -covermode=atomic -coverprofile=./$(value test_name)/covprofile -coverpkg=$(ROOT_PATH)/...
if [ -f ./$(value test_name)/covprofile ]; then rm ./$(value test_name)/covprofile; fi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use absolute path because
meet such error no packages being tested depend on matches for pattern /data/nvme0n1/husharp/proj/pd/client/../...

CGO_ENABLED=1 go test ./$(value test_name)/... -v -tags deadlock -race -cover -covermode=atomic -coverprofile=./$(value test_name)/covprofile -coverpkg=../../...

install-tools:
cd $(ROOT_PATH) && $(MAKE) install-tools
Expand Down