-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (54 loc) · 1.95 KB
/
Copy pathMakefile
File metadata and controls
71 lines (54 loc) · 1.95 KB
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
64
65
66
67
68
69
70
71
.PHONY: all build test test-race test-e2e test-e2e-short test-bench test-security test-integration clean lint vet fmt
GO ?= go
GOFLAGS ?= -mod=mod
TAGS ?=
all: vet build test
build:
$(GO) build $(GOFLAGS) ./shared/...
$(GO) build $(GOFLAGS) ./engine/...
$(GO) build $(GOFLAGS) ./cli/...
test:
$(GO) test $(GOFLAGS) -count=1 ./shared/... ./engine/... ./cli/... -timeout 180s
test-race:
$(GO) test $(GOFLAGS) -race -count=1 ./shared/... ./engine/... ./cli/... -timeout 300s
test-integration:
$(GO) test $(GOFLAGS) -tags=integration -count=1 ./shared/... ./engine/... ./cli/... -timeout 300s
GOEXE := $(shell $(GO) env GOEXE)
CLI_BIN := cli/devbox$(GOEXE)
test-e2e:
rm -f cli/devbox cli/devbox.exe
$(GO) build -o $(CLI_BIN) ./cli
$(GO) test $(GOFLAGS) -tags=e2e -count=1 ./tests/... -timeout 600s -v
test-e2e-short:
rm -f cli/devbox cli/devbox.exe
$(GO) build -o $(CLI_BIN) ./cli
$(GO) test $(GOFLAGS) -tags=e2e -count=1 -short ./tests/... -timeout 300s -v
test-bench:
rm -f cli/devbox cli/devbox.exe
$(GO) build -o $(CLI_BIN) ./cli
$(GO) test $(GOFLAGS) -tags=e2e -bench=. -benchtime=1x ./tests/... -run=^\$$ -timeout 600s -v 2>&1 | tee bench-results.txt
test-security:
rm -f cli/devbox cli/devbox.exe
$(GO) build -o $(CLI_BIN) ./cli
$(GO) test $(GOFLAGS) -tags=e2e -count=1 -short ./tests/... -run TestSecurity -timeout 300s -v
test-verbose:
$(GO) test $(GOFLAGS) -v -count=1 ./shared/... ./engine/... ./cli/... -timeout 180s
vet:
$(GO) vet $(GOFLAGS) ./shared/...
$(GO) vet $(GOFLAGS) ./engine/...
$(GO) vet $(GOFLAGS) ./cli/...
fmt:
$(GO) fmt ./shared/...
$(GO) fmt ./engine/...
$(GO) fmt ./cli/...
clean:
$(GO) clean -cache
rm -rf bin/
lint:
$(GO) vet $(GOFLAGS) ./shared/...
$(GO) vet $(GOFLAGS) ./engine/...
$(GO) vet $(GOFLAGS) ./cli/...
coverage:
$(GO) test $(GOFLAGS) -coverprofile=coverage.out -count=1 ./shared/... ./engine/... ./cli/... -timeout 180s
$(GO) tool cover -html=coverage.out -o coverage.html
$(GO) tool cover -func=coverage.out