From 7279c1d4d55c1f784dcee490f78bd39d8754da18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Barb=C3=A1chano?= Date: Mon, 30 Dec 2024 16:25:32 +0100 Subject: [PATCH] ci: print EC2 AMI in the pytest report header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is useful for validation tasks and when troubleshooting. Signed-off-by: Pablo Barbáchano --- tests/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 865fa0b44b2..0b059db15ea 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -67,6 +67,11 @@ def pytest_addoption(parser): ) +def pytest_report_header(): + """Pytest hook to print relevant metadata in the logs""" + return f"EC2 AMI: {global_props.ami}" + + @pytest.hookimpl(wrapper=True, tryfirst=True) def pytest_runtest_makereport(item, call): # pylint:disable=unused-argument """Plugin to get test results in fixtures