Skip to content

Commit 9a8697c

Browse files
committed
MINOR: make sequential package execution optional in test task
The test task previously hardcoded -p 1, forcing all test packages to run sequentially. This is required for integration tests (each package starts its own envtest and HAProxy instance, causing port races when run in parallel) but unnecessarily restrictive for unit-only runs. Add a SEQUENTIAL variable (default false, meaning no -p flag is passed and Go uses its own default). Set SEQUENTIAL=true to restore the -p 1 behaviour needed for integration test packages.
1 parent eaf029c commit 9a8697c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

taskfile.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ tasks:
8080
TOOL: envtest
8181
PKG: '{{default "./..." .PKG}}'
8282
FORMAT: '{{default "testdox" .FORMAT}}'
83+
SEQUENTIAL: '{{default "false" .SEQUENTIAL}}'
8384
POD_IP: "1.2.3.4"
8485
POD_NAME: "hug-7469984948-qgnfw"
8586
POD_NAMESPACE: "hug"
@@ -98,7 +99,7 @@ tasks:
9899
--format={{.FORMAT}} \
99100
--format-hide-empty-pkg \
100101
-- -count=1 \
101-
-p 1 \
102+
{{if eq .SEQUENTIAL "true"}}-p 1{{end}}\
102103
-tags="{{.TEST_TAGS}}" \
103104
-failfast \
104105
-v \

taskfile/conformance.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ tasks:
207207
CONFORMANCE_JUNIT_HTML_OUTPUT: '{{default "conformance-junit.html" .CONFORMANCE_JUNIT_HTML_OUTPUT}}'
208208
CONFORMANCE_RUN_TEST: '{{default "" .CONFORMANCE_RUN_TEST}}'
209209
CONFORMANCE_SKIP_TESTS: '{{default "" .CONFORMANCE_SKIP_TESTS}}'
210+
SEQUENTIAL: '{{default "false" .SEQUENTIAL}}'
210211
cmds:
211212
- |
212213
if CONFORMANCE_REPORT_OUTPUT={{.CONFORMANCE_REPORT_OUTPUT}} \
@@ -220,7 +221,7 @@ tasks:
220221
-tags=conformance \
221222
-timeout 60m \
222223
-v \
223-
-p 1 \
224+
{{if eq .SEQUENTIAL "true"}}-p 1{{end}}\
224225
-failfast \
225226
{{if .CONFORMANCE_RUN_TEST}}-run-test '{{.CONFORMANCE_RUN_TEST}}'{{end}} \
226227
{{if .CONFORMANCE_SKIP_TESTS}}-skip-tests '{{.CONFORMANCE_SKIP_TESTS}}'{{end}}; then

0 commit comments

Comments
 (0)