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

Conversation

malcolmholmes
Copy link
Collaborator

Go test does not report failure numbers. When making big changes this can make it hard to
analyse the output.

This PR adds gotestsum options to the makefile. It does this instead of replacing the
standard go test options to avoid a required dependency.

@malcolmholmes malcolmholmes requested a review from a team March 5, 2024 12:12
@@ -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?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants