Update */src/.cicd/test.sh

This commit is contained in:
Santiago Lo Coco 2023-11-01 12:20:18 -03:00
parent 5084c38283
commit cad88bf24e
4 changed files with 8 additions and 32 deletions

View File

@ -2,21 +2,14 @@
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
# Execute your command here
/usr/src/app/.venv/bin/gunicorn manage:app
else
## pytest
python -m pytest "src/tests" --junitxml=report.xml
## Coverage
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
## Linting
flake8 src --extend-ignore E221 --extend-ignore E501
# black src --check
# isort src --check
black src --check
isort . --src-path src --check --profile black
## Security
# bandit -c .bandit.yml -r .
fi

View File

@ -4,18 +4,12 @@
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
else
## pytest
python -m pytest "src/tests" --junitxml=report.xml
## Coverage
python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
## Linting
flake8 src --extend-ignore E221 --extend-ignore E501
# black src --check
# isort . --src-path src --check
black src --check
isort . --src-path src --check --profile black
## Security
# bandit -c .bandit.yml -r .
fi

View File

@ -4,20 +4,14 @@
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
else
## pytest
# python -m pytest "src/tests" --junitxml=report.xml
touch report.xml
# ## Coverage
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
touch coverage.xml
## Linting
flake8 src --extend-ignore E221 --extend-ignore E501
# black src --check
# isort . --src-path src --check
black src --check
isort . --src-path src --check --profile black
## Security
# bandit -c .bandit.yml -r .
fi

View File

@ -1,22 +1,17 @@
#!/bin/bash -e
if [ "${TEST_TARGET:-}" = "INTEGRATION" ]; then
/usr/src/app/.venv/bin/gunicorn src.api.main:app --worker-class uvicorn.workers.UvicornWorker
else
## pytest
# python -m pytest "src/tests" --junitxml=report.xml
touch report.xml
## Coverage
# python -m pytest "src/tests" -p no:warnings --cov="src" --cov-report xml
touch coverage.xml
## Linting
flake8 src --extend-ignore E221 --extend-ignore E501
# black src --check
# isort . --src-path src --check
black src --check
isort . --src-path src --check --profile black
## Security
# bandit -c .bandit.yml -r .
fi