Update */src/.cicd/test.sh
This commit is contained in:
parent
5084c38283
commit
cad88bf24e
|
@ -2,21 +2,14 @@
|
||||||
|
|
||||||
|
|
||||||
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
||||||
# Execute your command here
|
|
||||||
/usr/src/app/.venv/bin/gunicorn manage:app
|
/usr/src/app/.venv/bin/gunicorn manage:app
|
||||||
else
|
else
|
||||||
## pytest
|
|
||||||
python -m pytest "src/tests" --junitxml=report.xml
|
python -m pytest "src/tests" --junitxml=report.xml
|
||||||
|
|
||||||
## Coverage
|
|
||||||
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
||||||
|
|
||||||
|
|
||||||
## Linting
|
|
||||||
flake8 src --extend-ignore E221 --extend-ignore E501
|
flake8 src --extend-ignore E221 --extend-ignore E501
|
||||||
# black src --check
|
black src --check
|
||||||
# isort src --check
|
isort . --src-path src --check --profile black
|
||||||
|
|
||||||
## Security
|
|
||||||
# bandit -c .bandit.yml -r .
|
# bandit -c .bandit.yml -r .
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,18 +4,12 @@
|
||||||
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
||||||
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
|
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
|
||||||
else
|
else
|
||||||
## pytest
|
|
||||||
python -m pytest "src/tests" --junitxml=report.xml
|
python -m pytest "src/tests" --junitxml=report.xml
|
||||||
|
|
||||||
## Coverage
|
|
||||||
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
||||||
|
|
||||||
|
|
||||||
## Linting
|
|
||||||
flake8 src --extend-ignore E221 --extend-ignore E501
|
flake8 src --extend-ignore E221 --extend-ignore E501
|
||||||
# black src --check
|
black src --check
|
||||||
# isort . --src-path src --check
|
isort . --src-path src --check --profile black
|
||||||
|
|
||||||
## Security
|
|
||||||
# bandit -c .bandit.yml -r .
|
# bandit -c .bandit.yml -r .
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,20 +4,14 @@
|
||||||
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
||||||
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker --bind=0.0.0.0:5002
|
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker --bind=0.0.0.0:5002
|
||||||
else
|
else
|
||||||
## pytest
|
|
||||||
# python -m pytest "src/tests" --junitxml=report.xml
|
# python -m pytest "src/tests" --junitxml=report.xml
|
||||||
touch report.xml
|
touch report.xml
|
||||||
|
|
||||||
# ## Coverage
|
|
||||||
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
||||||
touch coverage.xml
|
touch coverage.xml
|
||||||
|
|
||||||
|
|
||||||
## Linting
|
|
||||||
flake8 src --extend-ignore E221 --extend-ignore E501
|
flake8 src --extend-ignore E221 --extend-ignore E501
|
||||||
# black src --check
|
black src --check
|
||||||
# isort . --src-path src --check
|
isort . --src-path src --check --profile black
|
||||||
|
|
||||||
## Security
|
|
||||||
# bandit -c .bandit.yml -r .
|
# bandit -c .bandit.yml -r .
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,22 +1,17 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
|
||||||
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
|
||||||
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
|
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
|
||||||
else
|
else
|
||||||
## pytest
|
|
||||||
# python -m pytest "src/tests" --junitxml=report.xml
|
# python -m pytest "src/tests" --junitxml=report.xml
|
||||||
touch report.xml
|
touch report.xml
|
||||||
|
|
||||||
## Coverage
|
|
||||||
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
|
||||||
touch coverage.xml
|
touch coverage.xml
|
||||||
|
|
||||||
## Linting
|
|
||||||
flake8 src --extend-ignore E221 --extend-ignore E501
|
flake8 src --extend-ignore E221 --extend-ignore E501
|
||||||
# black src --check
|
black src --check
|
||||||
# isort . --src-path src --check
|
isort . --src-path src --check --profile black
|
||||||
|
|
||||||
## Security
|
|
||||||
# bandit -c .bandit.yml -r .
|
# bandit -c .bandit.yml -r .
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue