Skip to content

Commit 15ac35a

Browse files
committed
Makefile: make test can focus with TESTS args
eg. make integration-test TESTS=TestOVSIntegrationTestSuite/TestMultipleOpsSameRow Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
1 parent 56515ff commit 15ac35a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
OVS_VERSION ?= v3.5.0
22

3+
TESTS ?=
4+
35
.PHONY: all
46
all: lint build test integration-test coverage
57

@@ -14,19 +16,19 @@ prebuild: modelgen ovsdb/serverdb/_server.ovsschema example/vswitchd/ovs.ovssche
1416
@go generate -v ./...
1517

1618
.PHONY: build
17-
build: prebuild
19+
build: prebuild
1820
@echo "+ $@"
1921
@go build -v ./...
2022

2123
.PHONY: test
2224
test: prebuild
2325
@echo "+ $@"
24-
@go test -race -coverprofile=unit.cov -test.short -timeout 30s -v ./...
26+
@go test -race -coverprofile=unit.cov -test.short -timeout 30s -v $(if $(TESTS),-run $(TESTS)) ./...
2527

2628
.PHONY: integration-test
2729
integration-test:
2830
@echo "+ $@"
29-
@go test -race -coverprofile=integration.cov -coverpkg=github.com/ovn-kubernetes/libovsdb/... -timeout 60s -v ./test/ovs
31+
@go test -race -coverprofile=integration.cov -coverpkg=github.com/ovn-kubernetes/libovsdb/... -timeout 60s -v $(if $(TESTS),-run $(TESTS)) ./test/ovs
3032

3133
.PHONY: coverage
3234
coverage: test integration-test

0 commit comments

Comments
 (0)