-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
63 lines (52 loc) · 1.04 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
GOOS ?= "linux"
GOARCH ?= "amd64"
NCPU ?= $(shell getconf _NPROCESSORS_ONLN)
all: build
.PHONY: clean
clean:
rm -rf build/
.PHONY: build
build:
mkdir -p build/
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o build/ktf.$(GOOS).$(GOARCH) cmd/ktf/main.go
.PHONY: install
install:
go install ./cmd/ktf
.PHONY: lint
lint:
@golangci-lint run -v ./...
.PHONY: test
test: test.unit
.PHONY: test.all
test.all: test.unit test.integration
.PHONY: test.unit
test.unit:
go test \
-race \
-v \
-covermode=atomic \
-coverprofile=unit.coverage.out \
-coverpkg=$(PKG_LIST) \
./pkg/...
TEST_RUN ?= ""
PKG_LIST ?= ./pkg/...,./internal/...
.PHONY: test.integration
test.integration:
@GOFLAGS="-tags=integration_tests" go test \
-parallel $(NCPU) \
-timeout 45m \
-run $(TEST_RUN) \
-race \
-v \
-covermode=atomic \
-coverprofile=integration.coverage.out \
-coverpkg=$(PKG_LIST) \
./test/integration/...
.PHONY: test.e2e
test.e2e:
@GOFLAGS="-tags=e2e_tests" go test \
-timeout 45m \
-run $(TEST_RUN) \
-race \
-v \
./test/e2e/...