From 000357e2d458afb9ae0e95bd939318c3acd7f174 Mon Sep 17 00:00:00 2001
From: phantomjinx
Date: Mon, 1 Jan 2024 16:48:31 +0000
Subject: [PATCH] chore: Format test results when compiling use gotestfmt
---
Makefile | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index d6aff0384..23a1b806e 100644
--- a/Makefile
+++ b/Makefile
@@ -103,8 +103,13 @@ compile:
go-generate:
go generate ./...
-test:
- CGO_ENABLED=0 go test -count=1 ./...
+gotestfmt-install:
+ifeq (, $(shell command -v gotestfmt 2> /dev/null))
+ go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
+endif
+
+test: gotestfmt-install
+ CGO_ENABLED=0 go test -count=1 ./... -json 2>&1 | gotestfmt
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=$(INSTALL_ROOT)/crd