From b944cbe069703dffbe7b554473a0d8e0adf20eac Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Fri, 18 Dec 2020 12:51:22 -0500 Subject: 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. --- tests/integration_tests/conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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" -- cgit v1.2.3