Skip to content

Commit

Permalink
remove vendor dependencies for build/lint/test rules in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
zshi-redhat committed Apr 3, 2019
1 parent ce0274a commit bab06a2
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 @@ -59,7 +59,7 @@ $(GOBIN):
$(BUILDDIR): | $(BASE) ; $(info Creating build directory...)
@cd $(BASE) && mkdir -p $@

build: $(BUILDDIR)/$(BINARY_NAME) | vendor ; $(info Building $(BINARY_NAME)...)
build: $(BUILDDIR)/$(BINARY_NAME) | ; $(info Building $(BINARY_NAME)...)
$(info Done!)

$(BUILDDIR)/$(BINARY_NAME): $(GOFILES) | $(BUILDDIR)
Expand Down Expand Up @@ -99,10 +99,10 @@ test-verbose: ARGS=-v ## Run tests in verbose mode with coverage repo
test-race: ARGS=-race ## Run tests with race detector
$(TEST_TARGETS): NAME=$(MAKECMDGOALS:test-%=%)
$(TEST_TARGETS): test
check test tests: fmt lint | $(BASE) vendor ; $(info running $(NAME:%=% )tests...) @ ## Run tests
check test tests: fmt lint | $(BASE) ; $(info running $(NAME:%=% )tests...) @ ## Run tests
$Q cd $(BASE) && $(GO) test -timeout $(TIMEOUT)s $(ARGS) $(TESTPKGS)

test-xml: fmt lint | $(BASE) $(GO2XUNIT) vendor ; $(info running $(NAME:%=% )tests...) @ ## Run tests with xUnit output
test-xml: fmt lint | $(BASE) $(GO2XUNIT) ; $(info running $(NAME:%=% )tests...) @ ## Run tests with xUnit output
$Q cd $(BASE) && 2>&1 $(GO) test -timeout 20s -v $(TESTPKGS) | tee test/tests.output
$(GO2XUNIT) -fail -input test/tests.output -output test/tests.xml

Expand All @@ -113,7 +113,7 @@ COVERAGE_HTML = $(COVERAGE_DIR)/index.html
.PHONY: test-coverage test-coverage-tools
test-coverage-tools: | $(GOCOVMERGE) $(GOCOV) $(GOCOVXML)
test-coverage: COVERAGE_DIR := $(CURDIR)/test/coverage.$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
test-coverage: fmt lint test-coverage-tools | $(BASE) vendor ; $(info running coverage tests...) @ ## Run coverage tests
test-coverage: fmt lint test-coverage-tools | $(BASE) ; $(info running coverage tests...) @ ## Run coverage tests
$Q mkdir -p $(COVERAGE_DIR)/coverage
$Q cd $(BASE) && for pkg in $(TESTPKGS); do \
$(GO) test \
Expand All @@ -128,7 +128,7 @@ test-coverage: fmt lint test-coverage-tools | $(BASE) vendor ; $(info running c
$Q $(GOCOV) convert $(COVERAGE_PROFILE) | $(GOCOVXML) > $(COVERAGE_XML)

.PHONY: lint
lint: | $(BASE) $(GOLINT) vendor ; $(info running golint...) @ ## Run golint
lint: | $(BASE) $(GOLINT) ; $(info running golint...) @ ## Run golint
$Q cd $(BASE) && ret=0 && for pkg in $(PKGS); do \
test -z "$$($(GOLINT) $$pkg | tee /dev/stderr)" || ret=1 ; \
done ; exit $$ret
Expand Down

0 comments on commit bab06a2

Please sign in to comment.