File tree Expand file tree Collapse file tree 6 files changed +41
-2
lines changed Expand file tree Collapse file tree 6 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1
1
.phony :
2
2
test
3
3
4
+ PROJECT_NAME =$(notdir $(PWD ) )
5
+ HOST_NAME =$(USER )
6
+ CONTAINER_UID =$(HOSTNAME ) _$(PROJECT_NAME )
4
7
5
- tests :
8
+ test-local :
6
9
@echo " *** ` tests` directory should exist at project root. Stop."
7
10
8
11
db-migration :
@@ -18,5 +21,21 @@ test-integration:
18
21
test-e2e :
19
22
pytest --color=yes --showlocals --tb=short -v tests/auth/e2e
20
23
21
- test : tests db-migration test-unit test-integration test-e2e
24
+ test-local : tests db-migration test-unit test-integration test-e2e
25
+
26
+ build :
27
+ docker-compose build
28
+
29
+ test :
30
+ docker-compose -p $(CONTAINER_UID ) run --rm --use-aliases --service-ports web docker/test.sh
31
+
32
+ clean :
33
+ docker-compose -p $(CONTAINER_UID ) down --remove-orphans --rmi all 2> /dev/null
34
+
35
+ web :
36
+ docker-compose -p $(CONTAINER_UID ) up
37
+
38
+ prune :
39
+ docker system prune -af
40
+
22
41
Original file line number Diff line number Diff line change
1
+ # /bin/bash
2
+ # sh ./docker/migration.sh && sh ./docker/uvicorn.sh
3
+ sh ./docker/migration.sh && sh ./docker/test.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ psql -v ON_ERROR_STOP=1 --username " $POSTGRES_USER " --dbname " $POSTGRES_DB " << -EOSQL
6
+ CREATE USER tester;
7
+ CREATE DATABASE court;
8
+ GRANT ALL PRIVILEGES ON DATABASE court TO tester;
9
+ EOSQL
Original file line number Diff line number Diff line change
1
+ alembic -x data=true downgrade base
2
+ alembic -x data=true upgrade head
Original file line number Diff line number Diff line change
1
+ #! /bash/sh
2
+ sh docker/migration.sh
3
+ pytest --color=yes --showlocals --tb=short -v tests/auth/unit
4
+ pytest --color=yes --showlocals --tb=short -v tests/auth/integration
5
+ pytest --color=yes --showlocals --tb=short -v tests/auth/e2e
Original file line number Diff line number Diff line change
1
+ uvicorn src.server.app:app --port $PORT --host $HOST --loop uvloop --log-level info --workers $MAX_CONCURRENCY
You can’t perform that action at this time.
0 commit comments