Skip to content

Commit 476253f

Browse files
yogesh-chauhanHarness
authored andcommitted
feat: add test target to Makefile with coverage reporting (#102)
* feat: add test target to Makefile with coverage reporting
1 parent 4d98297 commit 476253f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@ format: tools # Format go code and error if any changes are made
3333
@gci write --custom-order -s standard -s "prefix(github.com/harness/gitness)" -s default -s blank -s dot .
3434
@echo "Formatting complete"
3535

36-
.PHONY: help format tools
36+
###############################################################################
37+
#
38+
# Testing
39+
#
40+
###############################################################################
41+
42+
test: ## Run the go tests
43+
@echo "Running tests"
44+
@go test ./... -coverprofile=coverage.out
45+
@go tool cover -html=coverage.out
46+
47+
.PHONY: help format tools test
3748

3849
$(GOBIN)/gci:
3950
go install github.com/daixiang0/[email protected]

0 commit comments

Comments
 (0)