From 8af98accee855eb336a8f658d6d63e6de278e132 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 6 Jan 2025 14:12:34 +0100 Subject: [PATCH] Set gotestsum --format to github-actions when running on github (#2082) This gives grouping and ability to open individual test logs. --- .github/workflows/push.yml | 3 +++ Makefile | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f7c4d5456..a4a35420a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,6 +14,9 @@ on: branches: - main +env: + GOTESTSUM_FORMAT: github-actions + jobs: tests: runs-on: ${{ matrix.os }} diff --git a/Makefile b/Makefile index b6a62765f..f8b725900 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ default: build PACKAGES=./libs/... ./internal/... ./cmd/... ./bundle/... . +GOTESTSUM_FORMAT ?= pkgname-and-test-fails + lint: ./lint.sh ./... @@ -9,10 +11,10 @@ lintcheck: golangci-lint run ./... test: - gotestsum --format pkgname-and-test-fails --no-summary=skipped -- ${PACKAGES} + gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- ${PACKAGES} cover: - gotestsum --format pkgname-and-test-fails --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES} + gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES} showcover: go tool cover -html=coverage.txt