From de73779be9e47a6a9682d895c4b11ef48758f091 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Wed, 17 Jan 2024 12:01:13 -0300 Subject: [PATCH] Move libjuju pinning to a constraints file By default libjuju 2.9 will be used, this can overriden by passing the PIP_CONSTRAINTS environment variable Examples: PIP_CONSTRAINTS=./constraints-juju31.txt tox -e pep8 --recreate This allows running functional tests with different versions of juju --- constraints-juju29.txt | 1 + constraints-juju31.txt | 1 + constraints-juju32.txt | 1 + constraints-juju33.txt | 1 + test-requirements.txt | 3 +++ tox.ini | 11 +++-------- 6 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 constraints-juju29.txt create mode 100644 constraints-juju31.txt create mode 100644 constraints-juju32.txt create mode 100644 constraints-juju33.txt diff --git a/constraints-juju29.txt b/constraints-juju29.txt new file mode 100644 index 000000000..0919801a8 --- /dev/null +++ b/constraints-juju29.txt @@ -0,0 +1 @@ +juju>=2.9.0,<3.0.0 diff --git a/constraints-juju31.txt b/constraints-juju31.txt new file mode 100644 index 000000000..f54dea1ec --- /dev/null +++ b/constraints-juju31.txt @@ -0,0 +1 @@ +juju>=3.1.0,<3.2.0 diff --git a/constraints-juju32.txt b/constraints-juju32.txt new file mode 100644 index 000000000..7c6a709f1 --- /dev/null +++ b/constraints-juju32.txt @@ -0,0 +1 @@ +juju>=3.2.0,<3.3.0 diff --git a/constraints-juju33.txt b/constraints-juju33.txt new file mode 100644 index 000000000..67d9ebfdf --- /dev/null +++ b/constraints-juju33.txt @@ -0,0 +1 @@ +juju>=3.3.0,<3.4.0 diff --git a/test-requirements.txt b/test-requirements.txt index ff5879e3c..3c66eb3da 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,5 +16,8 @@ keystoneauth1 oslo.config python-novaclient tenacity>8.2.0 +# To force the installation of an specific version of libjuju use a constraints +# file, e.g.: `env PIP_CONSTRAINTS=./constraints-juju31.txt tox -e func-target` +juju # https://github.com/go-macaroon-bakery/py-macaroon-bakery/issues/94 macaroonbakery!=1.3.3 diff --git a/tox.ini b/tox.ini index 2cb5a78d6..878f0de43 100644 --- a/tox.ini +++ b/tox.ini @@ -17,23 +17,21 @@ passenv = CS_* OS_* TEST_* -extras = {env:EXTRA} + PIP_* deps = - -r{toxinidir}/test-requirements.txt + -c{env:PIP_CONSTRAINTS:{toxinidir}/constraints-juju29.txt} + -r{toxinidir}/test-requirements.txt commands = pytest --cov=./zaza/ {posargs} {toxinidir}/unit_tests [testenv:py3] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt [testenv:pep8] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt commands = flake8 {posargs} zaza unit_tests [testenv:venv] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt commands = /bin/true [flake8] @@ -51,7 +49,6 @@ commands = sphinx-build -W -b html -d {toxinidir}/doc/build/doctrees . {toxinidi [testenv:func] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt commands = {envdir}/bin/python3 setup.py install functest-run-suite --keep-faulty-model @@ -65,14 +62,12 @@ commands = [testenv:func-target-extended] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt commands = {envdir}/bin/python3 setup.py install functest-run-suite --keep-model --test-directory {toxinidir}/tests-extended --log INFO --bundle {posargs} [testenv:remove-placement] basepython = python3 -deps = -r{toxinidir}/test-requirements.txt commands = {envdir}/bin/python3 setup.py install remove-placement {posargs}