unit tests: Capture log output

Debugging unit test failures is very challenging because all of the log
output is mixed together. Capture the log messages and store them as
part of the test, so that only log messages associated with failures are
output, interleaved correctly with the results.

This does not capture logs sent to stdout by _early_log(), although that
would be a nice further improvement.

Change-Id: I01e409ea73ff444e16caae0078e81585c703d5a5
This commit is contained in:
Zane Bitter 2021-04-28 15:22:18 -04:00
parent c56cd4abc0
commit b510d2d4d0

View File

@ -11,6 +11,7 @@ setenv =
VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
OS_TEST_PATH=./ironic_python_agent/tests/unit
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
deps =