From f3555f27031c6b214b3f18dfde7624f7f2442925 Mon Sep 17 00:00:00 2001 From: benbierens Date: Sun, 8 Oct 2023 08:31:48 +0200 Subject: [PATCH] Adds node id to downloaded container logs --- Tests/CodexContinuousTests/ElasticSearchLogDownloader.cs | 7 ++++--- Tests/CodexContinuousTests/SingleTestRun.cs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/CodexContinuousTests/ElasticSearchLogDownloader.cs b/Tests/CodexContinuousTests/ElasticSearchLogDownloader.cs index c78ed63..6516b76 100644 --- a/Tests/CodexContinuousTests/ElasticSearchLogDownloader.cs +++ b/Tests/CodexContinuousTests/ElasticSearchLogDownloader.cs @@ -16,11 +16,11 @@ namespace ContinuousTests this.log = log; } - public void Download(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc) + public void Download(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc, string openingLine) { try { - DownloadLog(targetFile, container, startUtc, endUtc); + DownloadLog(targetFile, container, startUtc, endUtc, openingLine); } catch (Exception ex) { @@ -28,10 +28,11 @@ namespace ContinuousTests } } - private void DownloadLog(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc) + private void DownloadLog(LogFile targetFile, RunningContainer container, DateTime startUtc, DateTime endUtc, string openingLine) { log.Log($"Downloading log (from ElasticSearch) for container '{container.Name}' within time range: " + $"{startUtc.ToString("o")} - {endUtc.ToString("o")}"); + log.Log(openingLine); var http = CreateElasticSearchHttp(); var queryTemplate = CreateQueryTemplate(container, startUtc, endUtc); diff --git a/Tests/CodexContinuousTests/SingleTestRun.cs b/Tests/CodexContinuousTests/SingleTestRun.cs index 85283fa..1de3283 100644 --- a/Tests/CodexContinuousTests/SingleTestRun.cs +++ b/Tests/CodexContinuousTests/SingleTestRun.cs @@ -109,7 +109,8 @@ namespace ContinuousTests foreach (var node in nodes) { - elasticSearchLogDownloader.Download(fixtureLog.CreateSubfile(), node.Container, effectiveStart, effectiveEnd); + var openingLine = $"{node.Container.Name} = {node.GetDebugInfo().id}"; + elasticSearchLogDownloader.Download(fixtureLog.CreateSubfile(), node.Container, effectiveStart, effectiveEnd, openingLine); } }