-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (28 loc) · 1.06 KB
/
Makefile
File metadata and controls
32 lines (28 loc) · 1.06 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
.PHONY: test
test:
go test -tags=assert -race ./...
.PHONY: lint
lint:
golangci-lint run
.PHONY: benchmark
benchmark:
go test -bench=Benchmark -run="^$$" ./... | grep -v 'BenchmarkWriterMemory/'
go test -bench=BenchmarkWriterMemory -run="^$$" ./writers/
benchmark-ci:
go install go.bobheadxi.dev/gobenchdata@v1.2.1
go test -bench . -benchmem ./... -run="^$$" | grep -v 'BenchmarkWriterMemory/' | gobenchdata --json bench.json
rm -rf .delta.* && go run scripts/benchmark-delta/main.go bench.json
.PHONY: coverage
coverage:
go test -timeout 15m -coverprofile=coverage.out.tmp ./...
cat coverage.out.tmp | grep -vE "MockGen|codegen|mocks" > coverage.out
rm coverage.out.tmp
echo "| File | Function | Coverage |" > coverage.md
echo "| --- | --- | --- |" >> coverage.md
go tool cover -func=coverage.out | tail -n +2 | while read line; do \
file=$$(echo $$line | awk '{print $$1}'); \
func=$$(echo $$line | awk '{print $$2}'); \
cov=$$(echo $$line | awk '{print $$3}'); \
printf "| %s | %s | %s |\\n" "$$file" "$$func" "$$cov" >> coverage.md; \
done
rm coverage.out