Skip to content

Commit

Permalink
*: fix ci covprofile by updating codecov version and replacing cover …
Browse files Browse the repository at this point in the history
…pkg (#8044)

ref #4399

Signed-off-by: husharp <[email protected]>

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
HuSharp and ti-chi-bot[bot] authored Apr 9, 2024
1 parent 3475fe5 commit 2b8116e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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
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
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

0 comments on commit 2b8116e

Please sign in to comment.