-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_test.sh
executable file
·37 lines (24 loc) · 992 Bytes
/
run_test.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
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
: "${AIRFLOW__CORE__FERNET_KEY:=${FERNET_KEY:=$(python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print(FERNET_KEY)")}}"
export AIRFLOW__CORE__FERNET_KEY
# to initialize SQLite DB for running non-e2e test and Postgres DB for running e2e test
# airflow db init
# avoid issues with .pyc/pyo files when mounting source directory
export PYTHONOPTIMIZE=
echo "running unit tests"
pytest tests/unit_test/ -p no:cacheprovider -s --disable-warnings
echo "running dag validation tests"
pytest tests/dag_validation_test/ -p no:cacheprovider -s --disable-warnings
echo "running pylint"
PYLINTHOME=/tmp/datahub-dags-pylint \
pylint tests/ data_pipeline/ dags/
echo "running flake8"
flake8 tests/ data_pipeline/ dags/
echo "running mypy"
mypy tests/ data_pipeline/ dags/
if [[ $1 && $1 == "with-end-to-end" ]]; then
echo "running end to end tests"
pytest tests/end2end_test/ -p no:cacheprovider -s
fi
echo "done"