-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathMakefile
64 lines (52 loc) · 1.84 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
64
VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
TIME := $(shell date '+%Y-%m-%d_%H:%M:%S')
UPSTREAM_BRANCH ?= origin/master
.PHONY: build
build:
echo "Building for amd64..."
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-X github.com/ozontech/file.d/buildinfo.Version=${VERSION}" -o file.d ./cmd/file.d
.PHONY: cover
cover:
go test -short -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
rm coverage.out
.PHONY: test-short
test-short:
go test ./fd/ -v -count 1 -short
go test ./pipeline/ -v -count 1 -short
go test ./plugin/... -v -count 1 -short
.PHONY: test
test:
go test ./fd/ -v -count 1
go test ./pipeline/ -v -count 1
go test ./plugin/... -v -count 1
.PHONY: test-e2e
test-e2e:
go test ./e2e -tags=e2e_new -v -count 1
.PHONY: test-e2e-docker-up
test-e2e-docker-up:
for dc in $(shell find e2e -name 'docker-compose.yml') ; do \
docker compose -f $$dc up -d ; \
done
.PHONY: test-e2e-docker-down
test-e2e-docker-down:
for dc in $(shell find e2e -name 'docker-compose.yml') ; do \
docker compose -f $$dc down ; \
done
.PHONY: bench-file
bench-file:
go test -bench LightJsonReadPar ./plugin/input/file -v -count 1 -run -benchmem -benchtime 1x
.PHONY: gen-doc
gen-doc:
go run github.com/vitkovskii/[email protected]
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
.PHONY: mock
mock:
go run github.com/golang/mock/[email protected] -source=plugin/output/s3/s3.go -destination=plugin/output/s3/mock/s3.go
go run github.com/golang/mock/[email protected] -source=plugin/output/postgres/postgres.go -destination=plugin/output/postgres/mock/postgres.go
go run github.com/golang/mock/[email protected] -source=plugin/output/clickhouse/clickhouse.go -destination=plugin/output/clickhouse/mock/clickhouse.go Clickhouse
.PHONY: generate
generate: gen-doc mock
go generate ./...