-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tests.sh
executable file
·29 lines (20 loc) · 963 Bytes
/
run_tests.sh
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
#!/bin/bash
# Run the FastAPI app locally, using a temporary test dynamoDB instance, and run unit tests.
# Then also run static analysis and linting checks.
rm -rf package
export DB_TABLE_NAME=testTable
export TEST=true
# Prevent terminal output waiting:
export AWS_PAGER=""
docker run --rm --name dynamodb_test_local -d -p 8000:8000 amazon/dynamodb-local
sleep 5
./create_test_table.sh
python -m pytest --cov=fastapi_lambda/app tests -p no:cacheprovider
docker stop -t 0 dynamodb_test_local
python -m bandit -r . --exclude=/tests/,/venv/,/cloud_tests/,message_tests.py
python -m flake8 --exclude=tests/*,venv/*,cloud_tests/*,django_app/django_app/settings.py,django_app/app/migrations/*
python -m mypy . --explicit-package-bases --exclude 'tests/' --exclude 'venv/' --exclude 'cloud_tests/'
python -m pycodestyle fastapi_lambda
python -m pydocstyle fastapi_lambda --ignore=D107,D203,D213
python -m pylint fastapi_lambda
python -m pyright fastapi_lambda