Skip to content

Commit

Permalink
Don't test nrpe bits on rabbitmq-server. (#793)
Browse files Browse the repository at this point in the history
When the nrpe application is not deployed in the model skip the test
that checks for the correct configuration of the nagios checks, this is
because at the moment nrpe has no support for jammy, hence is not being
deployed in the jammy-yoga bundles.

Jammy support for nrpe is tracked at http://pad.lv/1968008

Also patch tox.ini and fix a test to allow the tests to pass.
  • Loading branch information
freyes authored and ajkavanagh committed Jan 11, 2023
1 parent b9f6774 commit 971bf80
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install "tox<4.0" tox-gh-actions
- name: Lint with tox
run: tox -e pep8
- name: Test with tox
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ juju_wait
# https://github.com/pyca/pyopenssl/commit/a145fc3bc6d2e943434beb2f04bbf9b18930296f
pyopenssl<22.1.0

PyYAML<=4.2,>=3.0
PyYAML<=4.2,>=3.0; python_version < '3.9'
PyYAML>4.2; python_version >='3.9'
flake8>=2.2.4
flake8-docstrings
flake8-per-file-ignores
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
]

tests_require = [
'tox >= 2.3.1',
'tox',
]


Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ skip_missing_interpreters = False
# https://stackoverflow.com/a/38133283
requires = pip < 20.3
virtualenv < 20.0
tox < 4.0.0
# NOTE: https://wiki.canonical.com/engineering/OpenStack/InstallLatestToxOnOsci
minversion = 3.2.0

[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
allowlist_externals =
{toxinidir}/pip.sh

install_command =
{toxinidir}/pip.sh install {opts} {packages}

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/utilities/test_zaza_utilities_series_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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()
self.prepare_series_upgrade.assert_called_once_with(
_machine_num, to_series=_to_series)
self.wrap_do_release_upgrade.assert_called_once_with(
Expand Down
7 changes: 7 additions & 0 deletions zaza/openstack/charm_tests/rabbitmq_server/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ def _retry_check_commands_on_units(self, cmds, units):

def test_414_rmq_nrpe_monitors(self):
"""Check rabbimq-server nrpe monitor basic functionality."""
try:
zaza.model.get_application("nrpe")
except KeyError:
logging.warn(("Skipping as nrpe is not deployed. "
"http://pad.lv/1968008"))
return

units = zaza.model.get_units(self.application_name)
host_names = generic_utils.get_unit_hostnames(units)

Expand Down

0 comments on commit 971bf80

Please sign in to comment.