Skip to content

Commit

Permalink
run tests with ginkgo
Browse files Browse the repository at this point in the history
  • Loading branch information
bakito committed Mar 29, 2023
1 parent d5337c1 commit 713ad09
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Run go golanci-lint
lint: golangci-lint
$(LOCALBIN)/golangci-lint run --fix
$(GOLANGCI_LINT) run --fix

# Run go mod tidy
tidy:
go mod tidy

# Run tests
test: tidy lint
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out
test: ginkgo tidy lint
$(GINKGO) -r --cover --coverprofile=coverage.out

release: semver
@version=$$($(LOCALBIN)/semver); \
Expand All @@ -30,11 +29,13 @@ $(LOCALBIN):
## Tool Binaries
SEMVER ?= $(LOCALBIN)/semver
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
GINKGO ?= $(LOCALBIN)/ginkgo
DEEPCOPY_GEN ?= $(LOCALBIN)/deepcopy-gen

## Tool Versions
SEMVER_VERSION ?= v1.1.3
GOLANGCI_LINT_VERSION ?= v1.52.2
GINKGO_VERSION ?= v2.9.2
DEEPCOPY_GEN_VERSION ?= v0.26.3

## Tool Installer
Expand All @@ -46,6 +47,10 @@ $(SEMVER): $(LOCALBIN)
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
.PHONY: ginkgo
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
$(GINKGO): $(LOCALBIN)
test -s $(LOCALBIN)/ginkgo || GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)
.PHONY: deepcopy-gen
deepcopy-gen: $(DEEPCOPY_GEN) ## Download deepcopy-gen locally if necessary.
$(DEEPCOPY_GEN): $(LOCALBIN)
Expand All @@ -57,9 +62,11 @@ update-toolbox-tools:
@rm -f \
$(LOCALBIN)/semver \
$(LOCALBIN)/golangci-lint \
$(LOCALBIN)/ginkgo \
$(LOCALBIN)/deepcopy-gen
toolbox makefile -f $(LOCALDIR)/Makefile \
github.com/bakito/semver \
github.com/golangci/golangci-lint/cmd/golangci-lint \
github.com/onsi/ginkgo/v2/ginkgo \
k8s.io/code-generator/cmd/deepcopy-gen@github.com/kubernetes/code-generator
## toolbox - end

0 comments on commit 713ad09

Please sign in to comment.