-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
48 lines (39 loc) · 1.66 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
SHELL := /bin/bash
LOCAL_DATABASE_URL := postgresql+psycopg://helpdesk:helpdesk_local@127.0.0.1:55432/helpdesk
SMOKE_EXERCISE_ID := 11111111-1111-4111-8111-111111111111
.PHONY: install migrate test up down down-clean verify
install:
uv sync
migrate:
docker compose run --rm helpdesk-api alembic upgrade head
test:
docker compose up -d --wait helpdesk-db
uv run pytest -q
up:
docker compose up -d --build --wait helpdesk-db
$(MAKE) migrate
docker compose up -d --build helpdesk-api helpdesk-worker
down:
docker compose down --remove-orphans
down-clean:
docker compose down --volumes --remove-orphans
verify: down-clean
docker compose up -d --build --wait helpdesk-db
$(MAKE) migrate
docker compose up -d --build helpdesk-api helpdesk-worker
@for attempt in {1..30}; do \
curl --fail --silent http://127.0.0.1:8080/health/ready >/dev/null && exit 0; \
sleep 1; \
done; echo 'Help Desk did not become ready' >&2; exit 1
@response=$$(curl --fail --silent \
-H 'Content-Type: application/json' \
-d '{"exercise_id":"$(SMOKE_EXERCISE_ID)","employee_name":"Verification User","subject":"Verify notification path","description":"Created by make verify."}' \
http://127.0.0.1:8080/api/requests); \
request_id=$$(printf '%s' "$$response" | uv run python -c 'import json,sys; print(json.load(sys.stdin)["id"])'); \
for attempt in {1..30}; do \
body=$$(curl --fail --silent "http://127.0.0.1:8080/api/requests/$$request_id"); \
printf '%s' "$$body" | grep -q '"notification_status":"completed"' && exit 0; \
sleep 1; \
done; echo 'Notification job did not complete' >&2; exit 1
uv run pytest -q
HELPDESK_DATABASE_URL='$(LOCAL_DATABASE_URL)' uv run alembic check