diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-12-18 12:51:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 12:51:22 -0500 |
commit | b944cbe069703dffbe7b554473a0d8e0adf20eac (patch) | |
tree | 324ca6566a193a8717ca4514bc486989f5ca870b | |
parent | 3c076f4cd1e7110883c723b163bfc9ca8f9d3f7b (diff) | |
download | vyos-cloud-init-b944cbe069703dffbe7b554473a0d8e0adf20eac.tar.gz vyos-cloud-init-b944cbe069703dffbe7b554473a0d8e0adf20eac.zip |
integration_tests: set log-cli-level to INFO by default (#737)
This gives us more detailed integration testing output by default.
This will make debugging failures reported by users/developers easier to
debug, as it removes the need for an initial round-trip to get the
output we need for debugging. It will also make debugging intermittent
failures easier: there will definitely be log output from runs which
exhibit the intermittent failure.
-rw-r--r-- | tests/integration_tests/conftest.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index 68d506bd..99dd8d9e 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -261,3 +261,20 @@ def pytest_assertrepr_compare(op, left, right): '"{}" not in cloud-init.log string; unexpectedly found on' " these lines:".format(left) ] + found_lines + + +def pytest_configure(config): + """Perform initial configuration, before the test runs start. + + This hook is only called if integration tests are being executed, so we can + use it to configure defaults for integration testing that differ from the + rest of the tests in the codebase. + + See + https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_configure + for pytest's documentation. + """ + if "log_cli_level" in config.option and not config.option.log_cli_level: + # If log_cli_level is available in this version of pytest and not set + # to anything, set it to INFO. + config.option.log_cli_level = "INFO" |