From 22150a20d94cddf2a41073e71a7f0e44bfb4bc51 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Thu, 11 Nov 2021 12:04:21 -0700 Subject: Add convenience symlink to integration test output (#1105) Integration test runs get unique log directories at /tmp/cloud_init_test_logs/$DATE_TIME. Make /tmp/cloud_init_test_logs/last always point to the most recent integration test directory. --- tests/integration_tests/conftest.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index 5a543e39..68b92e4b 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -190,6 +190,15 @@ def _collect_logs(instance: IntegrationInstance, node_id: str, integration_settings.LOCAL_LOG_PATH ) / session_start_time / node_id_path log.info("Writing logs to %s", log_dir) + + # Add a symlink to the latest log output directory + last_symlink = Path(integration_settings.LOCAL_LOG_PATH) / 'last' + if os.path.islink(last_symlink): + os.unlink(last_symlink) + os.symlink( + Path(integration_settings.LOCAL_LOG_PATH) / session_start_time, + last_symlink) + if not log_dir.exists(): log_dir.mkdir(parents=True) tarball_path = log_dir / 'cloud-init.tar.gz' -- cgit v1.2.3