diff --git a/.github/workflows/tox.yaml b/.github/workflows/tox.yaml index 3bdd5dba2..a950db6ed 100644 --- a/.github/workflows/tox.yaml +++ b/.github/workflows/tox.yaml @@ -5,11 +5,36 @@ on: - pull_request jobs: + build_old_versions: + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: ['3.6', '3.7'] + + 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] + python-version: [3.8, 3.9] steps: - uses: actions/checkout@v1 @@ -35,21 +60,11 @@ jobs: fail-fast: false matrix: juju_channel: - - latest/stable - 2.9/stable - - 2.8/stable bundle: - first - second - third - exclude: - # disable 'first' and 'second' bundles for juju 2.8 since 'magpie' - # is not a promulgated charm in the charmstore, only on charmhub - # which 2.8 can't talk to. - - juju_channel: 2.8/stable - bundle: first - - juju_channel: 2.8/stable - bundle: second env: TEST_ZAZA_BUG_LP1987332: "on" # http://pad.lv/1987332 needs: build @@ -67,6 +82,8 @@ jobs: sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket # until Juju provides stable IPv6-support we unfortunately need this lxc network set lxdbr0 ipv6.address none + sudo iptables -F FORWARD + sudo iptables -P FORWARD ACCEPT # pull images lxc image copy --alias juju/bionic/amd64 --copy-aliases ubuntu-daily:bionic local: lxc image copy --alias juju/focal/amd64 --copy-aliases ubuntu-daily:focal local: diff --git a/unit_tests/test_zaza_model.py b/unit_tests/test_zaza_model.py index d8a615d41..c8b0c9d1c 100644 --- a/unit_tests/test_zaza_model.py +++ b/unit_tests/test_zaza_model.py @@ -435,8 +435,9 @@ def test_block_until_auto_reconnect_model_disconnected_sync(self): # model.disconnect and model.connect should've each have been called # twice, once for run_in_model, and once each for the disconnection. self.Model_mock.disconnect.assert_has_calls([mock.call(), mock.call()]) - self.Model_mock.connect_model.has_calls([mock.call('modelname'), - mock.call('modelname')]) + self.Model_mock.connect_model.assert_has_calls( + [mock.call('modelname'), mock.call('testmodel')] + ) def test_block_until_auto_reconnect_model_disconnected_async(self): self._mocks_for_block_until_auto_reconnect_model( @@ -450,8 +451,9 @@ async def _async_true(): # model.disconnect and model.connect should've each have been called # twice, once for run_in_model, and once each for the disconnection. self.Model_mock.disconnect.assert_has_calls([mock.call(), mock.call()]) - self.Model_mock.connect_model.has_calls([mock.call('modelname'), - mock.call('modelname')]) + self.Model_mock.connect_model.assert_has_calls( + [mock.call('modelname'), mock.call('testmodel')] + ) def test_block_until_auto_reconnect_model_blocks_till_true(self): self._mocks_for_block_until_auto_reconnect_model(True, True) diff --git a/unit_tests/utilities/test_zaza_utilities_generic.py b/unit_tests/utilities/test_zaza_utilities_generic.py index bcad02dc4..4320062a8 100644 --- a/unit_tests/utilities/test_zaza_utilities_generic.py +++ b/unit_tests/utilities/test_zaza_utilities_generic.py @@ -243,7 +243,7 @@ def test_series_upgrade(self): _unit, _machine_num, origin=_origin, to_series=_to_series, from_series=_from_series, workaround_script=_workaround_script, files=_files) - self.block_until_all_units_idle.called_with() + self.block_until_all_units_idle.assert_called_with() self.prepare_series_upgrade.assert_called_once_with( _machine_num, to_series=_to_series) self.wrap_do_release_upgrade.assert_called_once_with(