
This PS upgrades Airflow to 2.10.4 and Openstack modules to 2024.1 Caracal versions Change-Id: I034cdf334f04f3d08af1891ac8db9ed9fd7177c8
149 lines
4.4 KiB
INI
149 lines
4.4 KiB
INI
[tox]
|
|
skipsdist=True
|
|
envlist = py310, pep8, bandit
|
|
|
|
[testenv]
|
|
setenv=
|
|
PYTHONWARNING=all
|
|
LANG=C.UTF-8
|
|
LC_ALL=C.UTF-8
|
|
deps =
|
|
-r{toxinidir}/requirements-frozen.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
[testenv:freeze]
|
|
recreate = True
|
|
allowlist_externals=
|
|
rm
|
|
sh
|
|
deps=
|
|
-r{toxinidir}/requirements-direct.txt
|
|
-c https://raw.githubusercontent.com/apache/airflow/constraints-2.10.4/constraints-3.10.txt
|
|
commands=
|
|
rm -f {toxinidir}/requirements-frozen.txt
|
|
sh -c "pip freeze --all | grep -vE 'shipyard_airflow|pyinotify|pkg-resources' > requirements-frozen.txt"
|
|
|
|
[testenv:safety]
|
|
basepython = python3
|
|
deps =
|
|
safety
|
|
allowlist_externals=
|
|
safety
|
|
commands =
|
|
safety check -r {toxinidir}/requirements-frozen.txt --full-report
|
|
|
|
[testenv:py310]
|
|
skipsdist=True
|
|
setenv=
|
|
SLUGIFY_USES_TEXT_UNIDECODE=yes
|
|
PYTHONWARNINGS=ignore::DeprecationWarning,ignore::FutureWarning
|
|
basepython=python3.10
|
|
allowlist_externals=
|
|
bash
|
|
airflow
|
|
../../../tools/wait_for_dag.sh
|
|
commands =
|
|
bash -c "rm -rf $HOME/airflow"
|
|
airflow version
|
|
airflow db init
|
|
airflow db migrate
|
|
airflow info
|
|
airflow dags list
|
|
airflow dags list-import-errors
|
|
bash -c "nohup airflow scheduler >/dev/null 2>&1 &"
|
|
../../../tools/wait_for_dag.sh
|
|
airflow dags list
|
|
airflow dags unpause example_bash_operator
|
|
airflow tasks test example_bash_operator runme_0
|
|
airflow dags backfill example_bash_operator -s 2018-01-01 -e 2018-01-02
|
|
airflow tasks run example_bash_operator runme_0 2018-01-01
|
|
airflow tasks states-for-dag-run example_bash_operator backfill__2018-01-01T00:00:00+00:00
|
|
airflow dags state example_bash_operator 2018-01-01
|
|
pytest {posargs} -vv
|
|
|
|
[testenv:cover]
|
|
skipsdist=True
|
|
setenv=
|
|
SLUGIFY_USES_TEXT_UNIDECODE=yes
|
|
PYTHONWARNINGS=ignore::DeprecationWarning,ignore::FutureWarning
|
|
allowlist_externals=
|
|
bash
|
|
airflow
|
|
../../../tools/wait_for_dag.sh
|
|
commands =
|
|
bash -c "rm -rf $HOME/airflow"
|
|
airflow version
|
|
airflow db init
|
|
airflow db migrate
|
|
airflow info
|
|
airflow dags list
|
|
airflow dags list-import-errors
|
|
bash -c "nohup airflow scheduler >/dev/null 2>&1 &"
|
|
../../../tools/wait_for_dag.sh
|
|
airflow dags list
|
|
airflow dags unpause example_bash_operator
|
|
airflow tasks test example_bash_operator runme_0
|
|
airflow dags backfill example_bash_operator -s 2018-01-01 -e 2018-01-02
|
|
airflow tasks run example_bash_operator runme_0 2018-01-01
|
|
airflow tasks states-for-dag-run example_bash_operator backfill__2018-01-02T00:00:00+00:00
|
|
airflow dags state example_bash_operator 2018-01-01
|
|
pytest \
|
|
{posargs} \
|
|
--cov-branch \
|
|
--cov-report=term-missing:skip-covered \
|
|
--cov-config=.coveragerc \
|
|
--cov=shipyard_airflow \
|
|
--cov-report html:cover \
|
|
--cov-report xml:cover/coverage.xml \
|
|
--cov-report term \
|
|
-vv
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8 {toxinidir}/shipyard_airflow
|
|
bandit -r shipyard_airflow
|
|
|
|
[testenv:bandit]
|
|
skipsdist= True
|
|
commands =
|
|
bandit -r shipyard_airflow -n 5
|
|
|
|
[testenv:genconfig]
|
|
setenv=
|
|
SLUGIFY_USES_TEXT_UNIDECODE=yes
|
|
commands =
|
|
pip install . --use-pep517
|
|
oslo-config-generator --config-file=generator/config-generator.conf
|
|
|
|
[testenv:genpolicy]
|
|
setenv=
|
|
SLUGIFY_USES_TEXT_UNIDECODE=yes
|
|
commands =
|
|
pip install . --use-pep517
|
|
oslopolicy-sample-generator --config-file=generator/policy-generator.conf
|
|
|
|
[testenv:gen_all]
|
|
# Combined to make these run together instead of setting up separately
|
|
skipsdist=True
|
|
setenv=
|
|
SLUGIFY_USES_TEXT_UNIDECODE=yes
|
|
commands =
|
|
pip install . --use-pep517
|
|
oslo-config-generator --config-file=generator/config-generator.conf
|
|
oslopolicy-sample-generator --config-file=generator/policy-generator.conf
|
|
|
|
[flake8]
|
|
filename = *.py
|
|
# NOTE(Bryan Strassner) ignoring F841 because of the airflow example pattern
|
|
# of naming variables even if they aren't used for DAGs and Operators.
|
|
# Doing so adds readability and context in this case.
|
|
# TODO(Bryan Strassner) The hacking rules defined as ignored below in many
|
|
# cases need to be un-ignored and fixed up. These are ignored because of
|
|
# the method in which test requirements bring in the hacking rules from
|
|
# other projects.
|
|
# W504 line break after binary operator
|
|
# TODO(rb560u): Address E722 violations
|
|
ignore = F841, H101, H201, H210, H238, H301, H304, H306, H401, H403, H404, H405, W504, E722
|
|
# NOTE(Bryan Strassner) excluding 3rd party and generated code that is brought into the
|
|
# codebase.
|
|
exclude = .venv,.git,.tox,build,dist,*lib/python*,*egg,alembic/env.py,docs
|