Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Juju 3.x Support #608

Merged
merged 26 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e45fd7f
Misc fixes for failing github workflows
javacruft Feb 23, 2023
3e7b2a5
pin juju upper constraint to <3.2
hemanthnakkina Jan 31, 2023
1eacbff
Switch functional testing to Juju 3.1
javacruft Feb 27, 2023
496746c
Pin Juju < 3.2 for testing
javacruft Feb 27, 2023
e7a5c91
Misc updates for 3.1 compatibility
javacruft Feb 27, 2023
bb72f5d
Generate temporary directory under $HOME
javacruft Feb 27, 2023
5997377
Make libjuju an extra dependency.
freyes Jul 14, 2023
2c03b5e
Add juju-3.2 support
freyes Jul 14, 2023
cab27ec
Move 'extras' to [testenv]
freyes Jul 14, 2023
278c541
Set skipsdist to False
freyes Jul 14, 2023
dcd2264
Fix testing matrix
freyes Jul 14, 2023
25c5f74
Add --classic when install juju 2.9
freyes Jul 14, 2023
5e138cb
Depend on 'juju' when no extra is passed.
freyes Jul 18, 2023
5acd3cf
Fix Code becoming integer.
Aug 24, 2023
8b1d54c
Use _normalise_action_object()
freyes Oct 5, 2023
e4ccfc2
Unpin libjuju
freyes Oct 5, 2023
0226e2f
Use action_obj.data['status']
freyes Oct 5, 2023
de73779
Move libjuju pinning to a constraints file
freyes Jan 17, 2024
c42c965
Pass a constraint to pin libjuju 3.x in the functional test
freyes Jan 17, 2024
28c13b7
Deny use of python-libjuju-2.9.45
freyes Jan 17, 2024
d374a08
Disabled juju 3.2 and 3.3 from the CI
freyes Jan 18, 2024
69ab4fa
Added note to leave a breadcrumb of consumers of the constraints file(s)
freyes Jan 18, 2024
227f3d5
Drop py36 testing from the CI
freyes Jan 19, 2024
dfbdbec
utilities: Convert juju base into Ubuntu series
fnordahl Dec 7, 2023
18c179e
Add constraints-juju-default.txt
freyes Feb 14, 2024
aec6e76
Run `juju-crashdump` instead of `juju crashdump`
freyes Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 28 additions & 4 deletions .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.10', '3.11']

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -36,10 +35,30 @@ jobs:
matrix:
juju_channel:
- 2.9/stable
- 3.1/stable
# - 3.2/stable
# - 3.3/stable
bundle:
- first
- second
- third
include:
- juju_channel: 2.9/stable
snap_install_flags: "--classic"
pip_constraints: constraints-juju29.txt
- juju_channel: 3.1/stable
snap_install_flags: ""
pip_constraints: constraints-juju31.txt
# NOTE(freyes): disabled until "RuntimeError: set_wakeup_fd only works
# in main thread of the main interpreter" gets fixed.
# https://pastebin.ubuntu.com/p/GfYKgpx3SP/
#
# - juju_channel: 3.2/stable
# snap_install_flags: ""
# pip_constraints: constraints-juju32.txt
# - juju_channel: 3.3/stable
# snap_install_flags: ""
# pip_constraints: constraints-juju33.txt
env:
TEST_ZAZA_BUG_LP1987332: "on" # http://pad.lv/1987332
needs: build
Expand All @@ -48,9 +67,13 @@ jobs:
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -yq snapd
sudo systemctl enable snapd
sudo systemctl restart snapd
python -m pip install --upgrade pip
pip install tox tox-gh-actions
sudo snap install --channel ${{ matrix.juju_channel }} --classic juju
sudo snap install ${{ matrix.snap_install_flags }} --channel ${{ matrix.juju_channel }} juju
sudo snap install --classic juju-crashdump
sudo lxd init --auto
# This is a throw-away CI environment, do not do this at home
Expand All @@ -64,11 +87,12 @@ jobs:
lxc image copy --alias juju/focal/amd64 --copy-aliases ubuntu-daily:focal local:
lxc image copy --alias juju/jammy/amd64 --copy-aliases ubuntu-daily:jammy local:
lxc image list
juju bootstrap --no-gui localhost
juju bootstrap localhost
- name: Functional test
run: |
set -euxo pipefail
mkdir logs
export PIP_CONSTRAINTS=$(pwd)/${{ matrix.pip_constraints }}
tox -e func-target -- ${{ matrix.bundle }} | tee logs/tox-output.txt
- name: crashdump on failure
if: failure()
Expand All @@ -77,7 +101,7 @@ jobs:
juju models
model=$(juju models --format yaml|grep "^- name:.*zaza"|cut -f2 -d/)
juju status -m $model | tee logs/juju-status.txt
juju crashdump -m $model -o logs/
juju-crashdump -m $model -o logs/
- name: upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
Expand Down
9 changes: 9 additions & 0 deletions constraints-juju-default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NOTE: this constraints file can be (and will be) consumed by downstream users.
#
# Known consumers:
# * zosci-config: job definitions that declare what juju version (snap channel)
# is used in tandem with this constraints file to lockdown python-libjuju
# version.
# * zaza-openstack-tests
#
juju>=3.1.0,<3.2.0
11 changes: 11 additions & 0 deletions constraints-juju29.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NOTE: this constraints file can be (and will be) consumed by downstream users.
#
# Known consumers:
# * zosci-config: job definitions that declare what juju version (snap channel)
# is used in tandem with this constraints file to lockdown python-libjuju
# version.
# * zaza-openstack-tests
#
# Reasons to block the use of a release:
# * 2.9.45, 2.9.46 - https://github.com/juju/python-libjuju/pull/975
juju>=2.9.0,<3.0.0,!=2.9.45,!=2.9.46
9 changes: 9 additions & 0 deletions constraints-juju31.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NOTE: this constraints file can be (and will be) consumed by downstream users.
#
# Known consumers:
# * zosci-config: job definitions that declare what juju version (snap channel)
# is used in tandem with this constraints file to lockdown python-libjuju
# version.
# * zaza-openstack-tests
#
juju>=3.1.0,<3.2.0
9 changes: 9 additions & 0 deletions constraints-juju32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NOTE: this constraints file can be (and will be) consumed by downstream users.
#
# Known consumers:
# * zosci-config: job definitions that declare what juju version (snap channel)
# is used in tandem with this constraints file to lockdown python-libjuju
# version.
# * zaza-openstack-tests
#
juju>=3.2.0,<3.3.0
9 changes: 9 additions & 0 deletions constraints-juju33.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# NOTE: this constraints file can be (and will be) consumed by downstream users.
#
# Known consumers:
# * zosci-config: job definitions that declare what juju version (snap channel)
# is used in tandem with this constraints file to lockdown python-libjuju
# version.
# * zaza-openstack-tests
#
juju>=3.3.0,<3.4.0
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pyparsing<3.0.0 # pin for aodhclient which is held for py35
async_generator
kubernetes<18.0.0; python_version < '3.6' # pined, as juju uses kubernetes
# pinned until 3.0 regressions are handled: https://github.com/openstack-charmers/zaza/issues/545
juju<3.0
juju_wait
PyYAML>=3.0
pbr==5.6.0
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@

'hvac<0.7.0',
'jinja2',
'juju<3.0',
'juju-wait',
'PyYAML',
'tenacity>8.2.0',
'python-libmaas',

# https://github.com/go-macaroon-bakery/py-macaroon-bakery/issues/94
'macaroonbakery != 1.3.3',
'juju',
]

tests_require = [
'tox >= 2.3.1',
]

extras_require = {
'testing': tests_require,
}


class Tox(TestCommand):
"""Tox class."""
Expand Down Expand Up @@ -113,8 +117,6 @@ def run_tests(self):
zip_safe=False,
cmdclass={'test': Tox},
install_requires=install_require,
extras_require={
'testing': tests_require,
},
tests_require=tests_require,
extras_require=extras_require,
)
5 changes: 3 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ keystoneauth1
oslo.config
python-novaclient
tenacity>8.2.0
# pinned until 3.0 regressions are handled: https://github.com/openstack-charmers/zaza/issues/545
juju<3.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
16 changes: 5 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = pep8,py3
skipsdist = True
skipsdist = False

# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.2.0
Expand All @@ -17,59 +17,53 @@ passenv =
CS_*
OS_*
TEST_*
PIP_*
deps =
-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]
ignore = E402,E226,W504
deps = -r{toxinidir}/test-requirements.txt
per-file-ignores =
unit_tests/**: D

[testenv:docs]
basepython = python3
changedir = doc/source
deps =
-r{toxinidir}/doc-requirements.txt
commands = sphinx-build -W -b html -d {toxinidir}/doc/build/doctrees . {toxinidir}/doc/build/html

[testenv:func]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands =
{envdir}/bin/python3 setup.py install
functest-run-suite --keep-faulty-model

[testenv:func-target]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands =
{envdir}/bin/python3 setup.py install
functest-run-suite --keep-model --bundle {posargs}

[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}