This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
37 lines (28 loc) · 1.65 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
docker-compose-e2e = ./e2e/docker-compose.yml
docker-compose-unit-tests = ./docker-compose.test.yml
skip_markers ?=
unit-tests: setup-unit-tests run-unit-tests
setup-unit-tests:
docker-compose -f $(docker-compose-unit-tests) up -d --build
POSTGRES_USER=mimic POSTGRES_PASSWORD=mimic ./scripts/wait-for-postgres.sh localhost 15432 mimic
run-unit-tests:
$(eval markers := $(skip_markers) $(if $(skip_markers), and) not e2e)
# _Warning_: the `django/` and `tests/` are mounted as volumes into a docker container. If your folder contains python bytecode (`__pycache__` folders),
# there might be an error when running pytest inside the `river` container. You can fix this by removing the pre-compiled bytecode files locally
find . | grep -E "(__pycache__|\.pyc|\.pyo$\)" | xargs rm -rf
docker-compose -f $(docker-compose-unit-tests) run --entrypoint pytest river -m "$(markers)"
stop-unit-tests:
docker-compose -f $(docker-compose-unit-tests) down
e2e-tests: setup-e2e-tests run-e2e-tests
setup-e2e-tests:
docker-compose -f $(docker-compose-e2e) up -d --build
POSTGRES_USER=test POSTGRES_PASSWORD=test ./scripts/wait-for-postgres.sh localhost 15432 test
./scripts/wait-for-webservice.sh http://localhost:8080/hapi
docker-compose -f $(docker-compose-e2e) exec -T jpaltime \
java -jar /app/hapi-fhir-cli.jar upload-definitions -v r4 -t http://localhost:8080/hapi/fhir
docker-compose -f $(docker-compose-e2e) run river-api migrate
run-e2e-tests:
$(eval markers := $(skip_markers) $(if $(skip_markers), and) e2e)
docker-compose -f $(docker-compose-e2e) run --entrypoint pytest river-api tests -m "$(markers)"
stop-e2e-tests:
docker-compose -f $(docker-compose-e2e) down