-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (43 loc) · 1.24 KB
/
Makefile
File metadata and controls
55 lines (43 loc) · 1.24 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
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITDATE ?= $(shell git show -s --format='%ct')
VERSION ?= v0.0.0
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
da-server:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/da-server ./cmd/daserver
build: da-server
lint:
golangci-lint run
fmt:
golangci-lint run --fix
clean:
rm bin/da-server
# Run all unit tests (excludes integration tests)
test:
go test -v ./... -tags='!integration'
# Run unit tests only (main package + subpackages, excludes integration/benchmark)
test-unit:
go test -v . ./fallback/... ./metrics/...
# Run integration tests that live under the ./tests/integration directory
TEST_REGEX ?=
TIMEOUT ?= 10m
test-integration:
go test -v -tags=integration -timeout=$(TIMEOUT) ./tests/integration/... $(if $(TEST_REGEX),-run $(TEST_REGEX),)
# Run benchmark tests
test-benchmark:
go test -v -bench=. -benchmem ./tests/benchmark/...
# Run all tests (unit + integration)
test-all: test test-integration
.PHONY: \
da-server \
build \
lint \
fmt \
clean \
test \
test-unit \
test-integration \
test-benchmark \
test-all