-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
66 lines (51 loc) · 1.74 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
65
66
GO ?= go
GOFMT ?= gofmt "-s"
PACKAGES ?= $(shell $(GO) list ./...)
GOFILES := $(shell find . -name "*.go" -type f -not -path './vendor/*')
COMPOSEFILES_ACCEPTANCE_TESTING = -f tests/docker-compose.yml -f tests/docker-compose.acceptance.yml
.PHONY: all
all: fmt lint vet test
.PHONY: build
build:
$(GO) build -o integration-test-runner .
.PHONY: test
test:
$(GO) test -cover -coverprofile=coverage.txt $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: test-short
test-short:
$(GO) test -cover -coverprofile=coverage.txt --short $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: fmt
fmt:
$(GOFMT) -w $(GOFILES)
.PHONY: lint
lint:
for pkg in ${PACKAGES}; do \
golint -set_exit_status $$pkg || GOLINT_FAILED=1; \
done; \
[ -z "$$GOLINT_FAILED" ]
.PHONY: vet
vet:
$(GO) vet $(PACKAGES)
.PHONY: clean
clean:
$(GO) clean -modcache -x -i ./...
find . -name coverage.txt -delete
.PHONY: acceptance-testing-build
acceptance-testing-build:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) build
.PHONY: acceptance-testing-up
acceptance-testing-up:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) up -d
.PHONY: acceptance-testing-run
acceptance-testing-run:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) exec acceptance-testing /testing/run.sh
.PHONY: acceptance-testing-update-golden-files
acceptance-testing-update-golden-files:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) exec acceptance-testing /testing/run.sh --update-goldens
.PHONY: acceptance-testing-logs
acceptance-testing-logs:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) ps -a
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) logs
.PHONY: acceptance-testing-down
acceptance-testing-down:
docker-compose $(COMPOSEFILES_ACCEPTANCE_TESTING) down