From 245d7f747fb69a419199ed6090496a001d3e44f8 Mon Sep 17 00:00:00 2001 From: Valentin Maerten Date: Sun, 24 Aug 2025 18:47:41 +0200 Subject: [PATCH] chore: use gotestsum for test (#2381) --- Taskfile.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index d2324d44..6b56089a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -8,6 +8,7 @@ includes: vars: BIN: "{{.ROOT_DIR}}/bin" + GOTESTSUM_FORMAT: '{{if .CI}}github-actions{{else}}pkgname{{end}}' env: CGO_ENABLED: '0' @@ -131,29 +132,37 @@ tasks: test: desc: Runs test suite aliases: [t] + deps: [gotestsum:install] sources: - "**/*.go" - "testdata/**/*" cmds: - - go test ./... + - gotestsum -f '{{.GOTESTSUM_FORMAT}}' ./... test:watch: desc: Runs test suite with watch tests included - deps: [sleepit:build] + deps: [sleepit:build, gotestsum:install] cmds: - - go test ./... -tags 'watch' + - gotestsum -f '{{.GOTESTSUM_FORMAT}}' ./... -tags 'watch' test:all: desc: Runs test suite with signals and watch tests included - deps: [sleepit:build] + deps: [sleepit:build, gotestsum:install] cmds: - - go test -tags 'signals watch' ./... + - gotestsum -f '{{.GOTESTSUM_FORMAT}}' -tags 'signals watch' ./... goreleaser:test: desc: Tests release process without publishing cmds: - goreleaser --snapshot --clean + gotestsum:install: + desc: Installs gotestsum + status: + - command -v gotestsum + cmds: + - go install gotest.tools/gotestsum@latest + goreleaser:install: desc: Installs goreleaser cmds: