-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
44 lines (32 loc) · 1.53 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
projectPath = $(shell pwd)
serverConfig ?= ./app/server/config/config.debug.yaml
build:
go build -o fq-connector-go ./app
run: build
./fq-connector-go server --config="$(serverConfig)"
lint:
golangci-lint run --fix ./app/... ./common/... ./tests/... ./tools/...
unit_test:
go test ./app/... ./common/... ./tests/utils/...
integration_test: integration_test_build
./fq-connector-go-tests -projectPath="$(projectPath)" -suiteName="$(suiteName)" -test.failfast
integration_test_build:
go test -c -o fq-connector-go-tests ./tests
integration_test_env_clean:
docker compose -f ./tests/infra/datasource/docker-compose.yaml down -v
integration_test_env_run: integration_test_env_clean
docker compose -f ./tests/infra/datasource/docker-compose.yaml up -d --build --pull=always
test_coverage: integration_test_env_run
go test -coverpkg=./... -coverprofile=coverage_unit_tests.out -covermode=atomic ./app/... ./common/... ./tests/utils/...
sleep 10
go test -c -o fq-connector-go-tests -coverpkg=./... -covermode=atomic ./tests
./fq-connector-go-tests -projectPath="$(projectPath)" -test.coverprofile=coverage_integration_tests.out
cat coverage_unit_tests.out | grep -v 'pb.go\|mock.go\|library' > coverage.out
cat coverage_integration_tests.out | grep -v 'atomic\|pb.go\|mock.go\|library' >> coverage.out
go tool cover -func=sudo apt install cloc
docker_compose_update:
go run ./tools/docker_compose_update -path="$(path)"
generate_docs:
python3 ./docs/generate.py ./docs
count_lines:
cloc --vcs=git . --exclude-dir=library,api --exclude-ext=pb.go