From 91182b56741025667141a7dfa310e07daac1a430 Mon Sep 17 00:00:00 2001 From: omkar sonawane Date: Sat, 5 Jul 2025 18:32:04 +0530 Subject: [PATCH] Add test targets to Makefile for improved testing workflow - Introduced new Makefile targets: `test`, `test-verbose`, and `test-coverage`. - The `test` target runs all tests with verbose output and race detection. - The `test-verbose` target runs tests with detailed output. - The `test-coverage` target generates a coverage report and an HTML view of the coverage results. --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile b/Makefile index c78c2ec..6766214 100644 --- a/Makefile +++ b/Makefile @@ -83,3 +83,20 @@ swagger-3-0: install-swag swagger-fix-refs: @./scripts/fix_swagger_refs.sh + + + +.PHONY: test test-verbose test-coverage + +# Run all tests +test: + go test -v -race ./internal/... + +# Run tests with verbose output +test-verbose: + go test -v ./internal/... + +# Run tests with coverage report +test-coverage: + go test -coverprofile=coverage.out ./internal/... + go tool cover -html=coverage.out -o coverage.html