forked from wesionaryTEAM/go_clean_architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (40 loc) · 1.41 KB
/
Makefile
File metadata and controls
56 lines (40 loc) · 1.41 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
56
include .env
export
MIGRATE=atlas migrate
migrate-status:
$(MIGRATE) status --url "postgres://$(DB_USER):$(DB_PASS)@:$(DB_FORWARD_PORT)/$(DB_NAME)?sslmode=disable"
migrate-diff:
$(MIGRATE) diff --env gorm
migrate-apply:
$(MIGRATE) apply --url "postgres://$(DB_USER):$(DB_PASS)@:$(DB_FORWARD_PORT)/$(DB_NAME)?sslmode=disable"
migrate-down:
$(MIGRATE) down --url "postgres://$(DB_USER):$(DB_PASS)@:$(DB_FORWARD_PORT)/$(DB_NAME)?sslmode=disable" --env gorm
migrate-hash:
$(MIGRATE) hash
lint-setup:
python3 -m ensurepip --upgrade
sudo pip3 install pre-commit
pre-commit install
pre-commit autoupdate
# Testing commands
test:
go test ./... -v
test-unit:
go test ./tests/unit/... -v
test-integration:
go test ./tests/integration/... -v
test-smoke:
go test ./tests/smoke/... -v
test-short:
go test ./... -v -short
test-coverage:
go test ./... -v -coverprofile=coverage.out -coverpkg=./...
go tool cover -func=coverage.out
test-coverage-html:
go test ./... -v -coverprofile=coverage.out -coverpkg=./...
go tool cover -html=coverage.out -o coverage.html
test-coverage-report:
@echo "Generating test coverage report..."
@go test ./... -v -coverprofile=coverage.out -coverpkg=./...
@go tool cover -func=coverage.out | tail -1
.PHONY: migrate-status migrate-diff migrate-apply migrate-down migrate-hash lint-setup test test-unit test-integration test-smoke test-short test-coverage test-coverage-html test-coverage-report