Add TEST_FILTER to Taskfile.yml
@@ -55,7 +55,7 @@ tasks:
desc: Run {{.GENERATOR_APP}} unit tests.
dir: "{{.GENERATOR_ROOT}}"
cmds:
- - go test ./... -tags=noexit
+ - go test ./... -tags=noexit -run '{{default ".*" .TEST_FILTER}}'
generator:update-golden-tests:
desc: Update {{.GENERATOR_APP}} golden test outputs.
@@ -85,7 +85,7 @@ tasks:
desc: Run {{.GENERATOR_APP}} unit tests and output coverage.
dir: "{{.GENERATOR_ROOT}}"
cmds:
- - go test ./... -tags=noexit -race -covermode atomic -coverprofile=generator-coverage.out -coverpkg=./...
+ - go test ./... -tags=noexit -race -covermode atomic -coverprofile=generator-coverage.out -coverpkg=./... -run '{{default ".*" .TEST_FILTER}}'
generator:build:
desc: Generate the {{.GENERATOR_APP}} binary.
@@ -142,14 +142,14 @@ tasks:
dir: "{{.CONTROLLER_ROOT}}"
deps: [controller:generate-crds]
cmds:
- - go test ./... -short -tags=noexit
+ - go test -short -tags=noexit -run '{{default ".*" .TEST_FILTER}}' ./...
controller:test-cover:
desc: Run {{.CONTROLLER_APP}} unit tests and output coverage.
dir: "{{.CONTROLLER_ROOT}}"
deps: [controller:generate-crds]
cmds:
- - go test -short -tags=noexit -race -covermode atomic -coverprofile=controller-coverage.out -coverpkg="./..." ./...
+ - go test -short -tags=noexit -race -covermode atomic -coverprofile=controller-coverage.out -coverpkg="./..." -run '{{default ".*" .TEST_FILTER}}' ./...
controller:build:
desc: Generate the {{.CONTROLLER_APP}} binary.
@@ -170,7 +170,7 @@ tasks:
deps: [controller:generate-crds]
cmds:
# -race fails at the moment in controller-runtime
- - go test -v ./...
+ - go test -v -run '{{default ".*" .TEST_FILTER}}' ./...
controller:test-integration-envtest-cover:
desc: Run integration tests with envtest using record/replay and output coverage.
@@ -178,7 +178,7 @@ tasks:
deps: [controller:generate-crds]
cmds:
# -race fails at the moment in controller-runtime
- - go test -covermode atomic -coverprofile=coverage-integration-envtest.out -coverpkg="./..." -v ./...
+ - go test -covermode atomic -coverprofile=coverage-integration-envtest.out -coverpkg="./..." -v -run '{{default ".*" .TEST_FILTER}}' ./...
controller:test-integration-envtest-live:
desc: Run integration tests with envtest against live data and output coverage.
@@ -186,7 +186,7 @@ tasks:
deps: [controller:generate-crds, cleanup-azure-resources]
cmds:
# -race fails at the moment in controller-runtime
- - RECORD_REPLAY=0 go test -timeout 30m -covermode atomic -coverprofile=coverage-integration-envtest-live.out -coverpkg="./..." -v ./...
+ - RECORD_REPLAY=0 go test -timeout 30m -covermode atomic -coverprofile=coverage-integration-envtest-live.out -coverpkg="./..." -v -run '{{default ".*" .TEST_FILTER}}' ./...
controller:generate-types:
desc: Run {{.GENERATOR_APP}} to generate input files for controller-gen for {{.CONTROLLER_APP}}.
