-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
57 lines (44 loc) · 1.54 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
export DOCKER_BUILDKIT=1
VERSION = $(strip $(shell poetry version --short))
.PHONY: help
help: ## Display this help message
@echo "Usage: make <target>"
@echo
@echo "Available targets:"
@grep --extended-regexp --no-filename '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s%s\n", $$1, $$2}'
PHONY: build
build: ## Build all Docker images
docker build --tag=camptocamp/tilecloud-chain-tests --target=tests .
docker build --tag=camptocamp/tilecloud-chain --build-arg=VERSION=$(VERSION) .
PHONY: checks
checks: prospector ## Run the checks
PHONY: prospector
prospector: ## Run Prospector
docker run --rm --volume=${PWD}:/app camptocamp/tilecloud-chain-tests prospector --output-format=pylint --die-on-tool-error
PHONY: tests
tests: build ## Run the unit tests
docker compose stop --timeout=0
docker compose down || true
docker compose up -d
# Wait for DB to be up
while ! docker compose exec -T test psql -h db -p 5432 -U postgresql -v ON_ERROR_STOP=1 -c "SELECT 1" -d tests; \
do \
echo "Waiting for DB to be UP"; \
sleep 1; \
done
c2cciutils-docker-logs
docker compose exec -T test pytest -vv --color=yes
c2cciutils-docker-logs
docker compose down
PYTEST_ARGS ?= --last-failed
PHONY: tests-fast
tests-fast:
docker compose up -d
# Wait for DB to be up
while ! docker compose exec -T test psql -h db -p 5432 -U postgresql -v ON_ERROR_STOP=1 -c "SELECT 1" -d tests; \
do \
echo "Waiting for DB to be UP"; \
sleep 1; \
done
docker compose exec -T test pytest -vvv --color=yes $(PYTEST_ARGS)