mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
chore: use gotestsum for test (#2381)
This commit is contained in:
19
Taskfile.yml
19
Taskfile.yml
@@ -8,6 +8,7 @@ includes:
|
|||||||
|
|
||||||
vars:
|
vars:
|
||||||
BIN: "{{.ROOT_DIR}}/bin"
|
BIN: "{{.ROOT_DIR}}/bin"
|
||||||
|
GOTESTSUM_FORMAT: '{{if .CI}}github-actions{{else}}pkgname{{end}}'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: '0'
|
CGO_ENABLED: '0'
|
||||||
@@ -131,29 +132,37 @@ tasks:
|
|||||||
test:
|
test:
|
||||||
desc: Runs test suite
|
desc: Runs test suite
|
||||||
aliases: [t]
|
aliases: [t]
|
||||||
|
deps: [gotestsum:install]
|
||||||
sources:
|
sources:
|
||||||
- "**/*.go"
|
- "**/*.go"
|
||||||
- "testdata/**/*"
|
- "testdata/**/*"
|
||||||
cmds:
|
cmds:
|
||||||
- go test ./...
|
- gotestsum -f '{{.GOTESTSUM_FORMAT}}' ./...
|
||||||
|
|
||||||
test:watch:
|
test:watch:
|
||||||
desc: Runs test suite with watch tests included
|
desc: Runs test suite with watch tests included
|
||||||
deps: [sleepit:build]
|
deps: [sleepit:build, gotestsum:install]
|
||||||
cmds:
|
cmds:
|
||||||
- go test ./... -tags 'watch'
|
- gotestsum -f '{{.GOTESTSUM_FORMAT}}' ./... -tags 'watch'
|
||||||
|
|
||||||
test:all:
|
test:all:
|
||||||
desc: Runs test suite with signals and watch tests included
|
desc: Runs test suite with signals and watch tests included
|
||||||
deps: [sleepit:build]
|
deps: [sleepit:build, gotestsum:install]
|
||||||
cmds:
|
cmds:
|
||||||
- go test -tags 'signals watch' ./...
|
- gotestsum -f '{{.GOTESTSUM_FORMAT}}' -tags 'signals watch' ./...
|
||||||
|
|
||||||
goreleaser:test:
|
goreleaser:test:
|
||||||
desc: Tests release process without publishing
|
desc: Tests release process without publishing
|
||||||
cmds:
|
cmds:
|
||||||
- goreleaser --snapshot --clean
|
- goreleaser --snapshot --clean
|
||||||
|
|
||||||
|
gotestsum:install:
|
||||||
|
desc: Installs gotestsum
|
||||||
|
status:
|
||||||
|
- command -v gotestsum
|
||||||
|
cmds:
|
||||||
|
- go install gotest.tools/gotestsum@latest
|
||||||
|
|
||||||
goreleaser:install:
|
goreleaser:install:
|
||||||
desc: Installs goreleaser
|
desc: Installs goreleaser
|
||||||
cmds:
|
cmds:
|
||||||
|
|||||||
Reference in New Issue
Block a user