From bf3995d6f5bd1678b8476726e3e96e90f1bb7ae9 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Thu, 10 Aug 2023 07:24:35 -0600 Subject: [PATCH] Clean up test targets in Makefile Most notably, replaces the test-it target with a more simply named test target. Signed-off-by: Jonathon Anderson --- .github/workflows/test.yml | 2 +- Makefile | 14 +++++++------- userdocs/contributing/debugging.rst | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc829b3d..e582f30d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,4 +41,4 @@ jobs: run: make vet - name: test - run: make test-it + run: make test diff --git a/Makefile b/Makefile index b4d6f86d..d336a82c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include Variables.mk all: config vendor wwctl wwclient man_pages wwapid wwapic wwapird etc/defaults.conf .PHONY: build -build: lint test-it vet all +build: lint test vet all .PHONY: setup_tools setup_tools: $(GO_TOOLS_BIN) $(GOLANGCI_LINT) @@ -49,17 +49,17 @@ lint: setup_tools vet: go vet ./... -.PHONY: test-it -test-it: - go test -v ./... +.PHONY: test +test: + go test ./... .PHONY: test-cover test-cover: - rm -fr coverage + rm -rf coverage mkdir coverage go list -f '{{if gt (len .TestGoFiles) 0}}"go test -covermode count -coverprofile {{.Name}}.coverprofile -coverpkg ./... {{.ImportPath}}"{{end}}' ./... | xargs -I {} bash -c {} - echo "mode: count" > coverage/cover.out - grep -h -v "^mode:" *.coverprofile >> "coverage/cover.out" + echo "mode: count" >coverage/cover.out + grep -h -v "^mode:" *.coverprofile >>"coverage/cover.out" rm *.coverprofile go tool cover -html=coverage/cover.out -o=coverage/cover.html diff --git a/userdocs/contributing/debugging.rst b/userdocs/contributing/debugging.rst index cf1c256d..d32affe0 100644 --- a/userdocs/contributing/debugging.rst +++ b/userdocs/contributing/debugging.rst @@ -21,12 +21,12 @@ vet`` on the full codebase. Running the full test suite =========================== -The Warewulf ``Makefile`` includes a ``test-it`` target which runs the +The Warewulf ``Makefile`` includes a ``test`` target which runs the full test suite. .. code-block:: console - $ make test-it + $ make test Using delve