Skip to content

Commit

Permalink
chore: all go package in coverage (#5776)
Browse files Browse the repository at this point in the history
Signed-off-by: richardlt <richard.le.terrier@gmail.com>
  • Loading branch information
richardlt committed Mar 23, 2021
1 parent 25dda4d commit 7c51d7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cli/cdsctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ GO_LINT = ${GOPATH}/bin/gometalinter
GO_COV_MERGE = ${GOPATH}/bin/gocovmerge
GO_GO2XUNIT = ${GOPATH}/bin/go2xunit

PKGS_COMMA_SEP = go list -f '{{ join .Deps "\n" }}{{"\n"}}{{.ImportPath}}' . | grep github.com/ovh/cds | grep -v vendor | tr '\n' ',' | sed 's/,$$//'

define get_os_from_binary_file
$(strip $(shell echo $(1) | cut -d'-' -f 2))
endef
Expand Down Expand Up @@ -72,7 +74,8 @@ gobuild:
build: $(TARGET_DIR) $(TARGET_BINARIES_VARIANT) $(TARGET_BINARIES)

build_test_cdsctl:
CGO_ENABLED=1 go test -coverpkg="./..." -c . -o $(TARGET_DIR)/$(TARGET_BINARY).test -tags testbincover,nokeychain
TEMP=`$(PKGS_COMMA_SEP)`; \
CGO_ENABLED=1 go test -coverpkg $$TEMP -c . -o $(TARGET_DIR)/$(TARGET_BINARY).test -tags testbincover,nokeychain;

test: clean
@for PKG in $(TEST_PKGS); do \
Expand Down
3 changes: 2 additions & 1 deletion engine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ $(TARGET_ENGINE_BINARIES): $(TARGET_DIR)
build_all_engine: $(TARGET_ENGINE_BINARIES)

build_test_engine:
CGO_ENABLED=1 go test -race -coverpkg="./..." -c . -o $(TARGET_DIR)/$(TARGET_ENGINE).test -tags testbincover
TEMP=`$(PKGS_COMMA_SEP)`; \
CGO_ENABLED=1 go test -race -coverpkg $$TEMP -c . -o $(TARGET_DIR)/$(TARGET_ENGINE).test -tags testbincover;

test-redis-start-docker:
$(TEST_REDIS_START_DOCKER)
Expand Down

0 comments on commit 7c51d7b

Please sign in to comment.