Skip to content

Commit

Permalink
Move libjuju pinning to a constraints file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
freyes committed Jan 17, 2024
1 parent 0226e2f commit de73779
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions constraints-juju29.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
juju>=2.9.0,<3.0.0
1 change: 1 addition & 0 deletions constraints-juju31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
juju>=3.1.0,<3.2.0
1 change: 1 addition & 0 deletions constraints-juju32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
juju>=3.2.0,<3.3.0
1 change: 1 addition & 0 deletions constraints-juju33.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
juju>=3.3.0,<3.4.0
3 changes: 3 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 3 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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}

0 comments on commit de73779

Please sign in to comment.