forked from bippio/go-impala
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (40 loc) · 1.96 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
.PHONY: thrift
thrift:
thrift -r -gen go:package_prefix=github.com/sclgo/impala-go/internal/generated/ interfaces/ImpalaService.thrift
rm -rf ./internal/generated/
mv gen-go ./internal/generated/
.PHONY: cli
cli: usql
usql:
go run github.com/sclgo/usqlgen@v0.1.1 -v build --import github.com/sclgo/impala-go
.PHONY: test-cli
test-cli: usql
./usql -c "\drivers" | grep impala
PKGS=$(shell go list ./... | grep -v "./internal/generated")
PKGS_LST=$(shell echo ${PKGS} | tr ' ' ',')
test:
mkdir -p coverage/covdata
# Use the new binary format to ensure integration tests and cross-package calls are counted towards coverage
# https://go.dev/blog/integration-test-coverage
# -coverpkg can't be ./... because that will include generated code in the stats
# -p 1 disable parallel testing in favor of streaming log output - https://github.com/golang/go/issues/24929#issuecomment-384484654
go test -race -cover -covermode atomic -coverpkg "${PKGS_LST}" -v -vet=all -timeout 15m -p 1\
${PKGS} \
-args -test.gocoverdir="${PWD}/coverage/covdata" \
| ts -s
# NB: ts command requires moreutils package; awk trick from https://stackoverflow.com/a/25764579 doesn't stream output
go tool covdata percent -i=./coverage/covdata
# Convert to old text format for coveralls upload
go tool covdata textfmt -i=./coverage/covdata -o ./coverage/covprofile
go tool cover -html=./coverage/covprofile -o ./coverage/coverage.html
check_changes:
# make sure .next.version contains the intended next version
# if the following fails, update either the next version or undo any unintended api changes
go run golang.org/x/exp/cmd/gorelease@latest -version $(shell cat .next.version)
check_deps:
# checks for possibly leaked dependencies like in
# https://www.dolthub.com/blog/2022-11-07-pruning-test-dependencies-from-golang-binaries/
go build ./examples/enumerateDB.go
strings enumerateDB | grep -m 1 github.com/sclgo/impala-go # sanity
! (strings enumerateDB | grep testify)
! (strings enumerateDB | grep docker)