Skip to content

Commit

Permalink
Enable unit test
Browse files Browse the repository at this point in the history
enable unit test by uncommenting main in .prow.sh. Add test module in
Makefile. Due to the issue related to guid package microsoft/go-winio#169 which causes errors when running unit tests on Linux, the current solution is to add some filter for the test path. Will update it after the issue is resolved.
  • Loading branch information
jingxu97 committed Mar 7, 2020
1 parent 2eb1ac1 commit 3c28bfd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .prow.sh
Expand Up @@ -9,4 +9,4 @@

# TODO: Once we add windows build rules and a Makefile, we can enable
# some basic unit testing
# main
main
10 changes: 9 additions & 1 deletion Makefile
Expand Up @@ -15,7 +15,7 @@ BUILD_TOOLS_DIR = $(BUILD_DIR)/tools
GO_ENV_VARS = GO111MODULE=on GOOS=windows

.PHONY: all
all: generate compile lint
all: compile test

.PHONY: compile
compile: compile-client compile-server compile-csi-proxy-api-gen
Expand Down Expand Up @@ -74,6 +74,14 @@ lint: $(GOLANGCI_LINT)
$(GO_ENV_VARS) $(GOLANGCI_LINT) run
git --no-pager diff --exit-code

.PHONY: test-go
test: test-go
test-go:
@ echo; echo "### $@:"
# TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
go test `find ./internal/server/ -type d -not -name server`;\
cd client; go test `go list ./... | grep -v group`; cd ../

# see https://github.com/golangci/golangci-lint#binary-release
$(GOLANGCI_LINT):
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$$(dirname '$(GOLANGCI_LINT)')" '$(GOLANGCI_LINT_VERSION)'

0 comments on commit 3c28bfd

Please sign in to comment.