Skip to content

Commit

Permalink
Reduce unit test time
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll committed Oct 3, 2024
1 parent ea3a90e commit 7f373dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,11 @@ cover_profile:
$Q echo Running special test cases without race detector:
$Q go test ./cmd/server/cadence/
$Q echo Running package tests:
$Q for dir in $(PKG_TEST_DIRS); do \
mkdir -p $(BUILD)/"$$dir"; \
go test "$$dir" $(TEST_ARG) -coverprofile=$(BUILD)/"$$dir"/coverage.out || exit 1; \
(cat $(BUILD)/"$$dir"/coverage.out | grep -v "^mode: \w\+" >> $(UNIT_COVER_FILE)) || true; \
done;
$Q echo $(PKG_TEST_DIRS) | tr ' ' '\n' | xargs -P $(shell nproc) -I {} sh -c \
'mkdir -p $(BUILD)/"{}" && go test "{}" $(TEST_ARG) -coverprofile=$(BUILD)/"{}"/coverage.out || exit 1'
$Q echo Merging coverage profiles:
$Q find $(BUILD) -name coverage.out | xargs cat | grep -v "^mode:" >> $(UNIT_COVER_FILE)


cover_integration_profile:
$Q mkdir -p $(BUILD)
Expand Down

0 comments on commit 7f373dc

Please sign in to comment.