Skip to content

Commit fd35878

Browse files
committed
Fix error in go test command template
Task's `default` template command uses the first value if the second is not defined. In this case, the second value was a variable defined by the workflow, so it was always defined! This made the default command and the first value useless. My interpretation is that the intent was, as is done successfully elsewhere, to allow the task user to make customizations by defining an environment variable from the command line which will override the default value. In order to accomplish that in a clean manner, I made the following changes: - Remove the frivolous taskfile variable, instead adding the flags directly to the template - Hard code the `-v` flag into the command - Add an override variable with a more relevant name
1 parent 75ab8aa commit fd35878

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ vars:
2828
-X {{.CONFIGURATION_PACKAGE}}.Commit={{.COMMIT}}
2929
-X {{.CONFIGURATION_PACKAGE}}.Timestamp={{.TIMESTAMP}}
3030
'
31-
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
3231
DOCS_VERSION: dev
3332
DOCS_ALIAS: ""
3433
DOCS_REMOTE: "origin"
@@ -71,9 +70,10 @@ tasks:
7170
cmds:
7271
- |
7372
go test \
73+
-v \
7474
-short \
75-
{{default "-v" .GOFLAGS}} \
7675
-run '{{default ".*" .GO_TEST_REGEX}}' \
76+
{{default "-timeout 10m -coverpkg=./... -covermode=atomic" .GO_TEST_FLAGS}} \
7777
-coverprofile=coverage_unit.txt \
7878
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
7979

0 commit comments

Comments
 (0)