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

Remove juju upper constraint #587

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,35 @@ on:
- pull_request

jobs:
build_old_versions:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.6']

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install codecov tox tox-gh-actions
- name: Lint with tox
run: tox -e pep8
- name: Test with tox
run: tox -e py
- name: Codecov
run: |
set -euxo pipefail
codecov --verbose --gcov-glob unit_tests/*
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
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
juju_wait
PyYAML>=3.0
pbr==5.6.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

'hvac<0.7.0',
'jinja2',
'juju<3.0',
'juju',
'juju-wait',
'PyYAML',
'tenacity',
Expand Down
9 changes: 7 additions & 2 deletions unit_tests/test_zaza_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ async def _inner_is_leader():
self.run_action = mock.MagicMock()
self.run_action.wait.side_effect = _wait
self.action = mock.MagicMock()
self.action.wait.side_effect = _wait
self.action.data = {
'model-uuid': '1a035018-71ff-473e-8aab-d1a8d6b6cda7',
'id': 'e26ffb69-6626-4e93-8840-07f7e041e99d',
Expand Down Expand Up @@ -493,7 +494,9 @@ def test_block_until_auto_reconnect_model_disconnected_sync(self):
with mock.patch.object(zaza, 'RUN_LIBJUJU_IN_THREAD', new=False):
model.sync_wrapper(self._wrapper)()
self.Model_mock.disconnect.assert_has_calls([mock.call()])
self.Model_mock.connect_model.has_calls([mock.call('modelname')])
self.Model_mock.connect_model.assert_has_calls(
[mock.call('testmodel')]
)

def test_block_until_auto_reconnect_model_disconnected_async(self):
self._mocks_for_block_until_auto_reconnect_model(
Expand All @@ -506,7 +509,9 @@ async def _async_true():
with mock.patch.object(zaza, 'RUN_LIBJUJU_IN_THREAD', new=False):
model.sync_wrapper(self._wrapper)()
self.Model_mock.disconnect.assert_has_calls([mock.call()])
self.Model_mock.connect_model.has_calls([mock.call('modelname')])
self.Model_mock.connect_model.assert_has_calls(
[mock.call('testmodel')]
)

def test_block_until_auto_reconnect_model_blocks_till_true(self):
self._mocks_for_block_until_auto_reconnect_model(True, True)
Expand Down
Loading