Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gotestsum options to makefile #367

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ test-clean:
test:
go test -v ./cmd/... ./pkg/...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

GOTEST ?= "go test"

test:
	$(GOTEST) -v ./cmd/... ./pkg/...

Then you can you can run it like this: `GOTEST="gotestsum" make test"

It feels weird because this doesn't do anything different other than replacing go test with an external exec

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -v must be inside the GOTEST=.

The downside of this approach is it means I need to remember the syntax. I guess the makefile can have a comment (or a target that sets GOTEST?)


testsum:
gotestsum ./cmd/... ./pkg/...

integration: run-test-image-locally dev
go test -v ./integration/...
make stop-test-image-locally

integrationsum: run-test-image-locally dev
gotestsum ./integration/...
make stop-test-image-locally

# Compilation
dev:
go build -ldflags "-X main.Version=dev-${VERSION}" ./cmd/grr
Expand Down
Loading