#9458 Nightly test failure (with healthcheck 0.14) in test_ipahealthcheck.py::TestIpaHealthCLI::test_indent
Closed: fixed by frenaud. Opened by frenaud.

The nightly test test_ipahealthcheck.py::TestIpaHealthCLI::test_indent is failing when executed with freeipa-healthcheck 0.14 because an error message has changed (validating that --indent argument is an integer).

Example of test failure in PR #3024 with test_ipahealthcheck_cli_fsspace report.html:

    def test_indent(self):
        """
        Use illegal values for indent
        """
        for option in ('a', '9.0'):
            cmd = self.base_cmd + ["--indent", option]
            result = self.master.run_command(cmd, raiseonerr=False)
            assert result.returncode == 2
>           assert 'invalid int value' in result.stderr_text
E           assert 'invalid int value' in "usage: ipa-healthcheck [-h] [--config CONFIG] [--verbose] [--debug]\n                       [--list-sources] [--source SOURCE] [--check CHECK]\n                       [--output-type {json,human,prometheus}]\n                       [--output-file OUTPUT_FILE] [--version]\n                       [--indent INDENT] [--metric-prefix METRIC_PREFIX]\n                       [--input-file INFILE] [--failures-only] [--all]\n                       [--severity {SUCCESS,WARNING,ERROR,CRITICAL}]\nipa-healthcheck: error: argument --indent: 'a' is not an integer\n"
E            +  where "usage: ipa-healthcheck [-h] [--config CONFIG] [--verbose] [--debug]\n                       [--list-sources] [--source SOURCE] [--check CHECK]\n                       [--output-type {json,human,prometheus}]\n                       [--output-file OUTPUT_FILE] [--version]\n                       [--indent INDENT] [--metric-prefix METRIC_PREFIX]\n                       [--input-file INFILE] [--failures-only] [--all]\n                       [--severity {SUCCESS,WARNING,ERROR,CRITICAL}]\nipa-healthcheck: error: argument --indent: 'a' is not an integer\n" = <pytest_multihost.transport.SSHCommand object at 0x7f376569a250>.stderr_text

With ipa-healthcheck 0.12:

# ipa-healthcheck --indent a
usage: ipa-healthcheck [-h] [--config CONFIG] [--verbose] [--debug]
                       [--list-sources] [--source SOURCE] [--check CHECK]
                       [--output-type {json,human,prometheus}]
                       [--output-file OUTPUT_FILE] [--version]
                       [--indent INDENT] [--metric-prefix METRIC_PREFIX]
                       [--input-file INFILE] [--failures-only] [--all]
                       [--severity {SUCCESS,WARNING,ERROR,CRITICAL}]
ipa-healthcheck: error: argument --indent: invalid int value: 'a'

With ipa-healthcheck 0.14:

# ipa-healthcheck --indent a
usage: ipa-healthcheck [-h] [--config CONFIG] [--verbose] [--debug]
                       [--list-sources] [--source SOURCE] [--check CHECK]
                       [--output-type {json,human,prometheus}]
                       [--output-file OUTPUT_FILE] [--version]
                       [--indent INDENT] [--metric-prefix METRIC_PREFIX]
                       [--input-file INFILE] [--failures-only] [--all]
                       [--severity {SUCCESS,WARNING,ERROR,CRITICAL}]
ipa-healthcheck: error: argument --indent: 'a' is not an integer

The test code needs to be adapted.


Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/7019

master:

  • e459e5b8bc81c4bb3b39dc51a50f388a8c8dd34d ipatests: fix healthcheck test for --indent option

ipa-4-11:

  • ca4ac6c06dd37deab5ba7c4df8789acf9e45d03e ipatests: fix healthcheck test for --indent option

ipa-4-10:

  • 1596eb2a96852b3cd940174c7bc1c0681e8f0297 ipatests: fix healthcheck test for --indent option

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata