From 647022a27eae2d100c166122daccae647f4ef22b Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 31 Aug 2023 09:50:34 +0200 Subject: [PATCH] Updates overview log for all-nodes tests. --- ContinuousTests/SingleTestRun.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ContinuousTests/SingleTestRun.cs b/ContinuousTests/SingleTestRun.cs index 4d9a041..3d9c03d 100644 --- a/ContinuousTests/SingleTestRun.cs +++ b/ContinuousTests/SingleTestRun.cs @@ -36,7 +36,7 @@ namespace ContinuousTests fixtureLog = new FixtureLog(new LogConfig(config.LogPath, true), DateTime.UtcNow, testName); ApplyLogReplacements(fixtureLog, startupChecker); - nodes = CreateRandomNodes(handle.Test.RequiredNumberOfNodes); + nodes = CreateRandomNodes(); dataFolder = config.DataPath + "-" + Guid.NewGuid(); fileManager = new FileManager(fixtureLog, CreateFileManagerConfiguration()); } @@ -219,19 +219,26 @@ namespace ContinuousTests private void OverviewLog(string msg) { Log(msg); - var containerNames = $"({string.Join(",", nodes.Select(n => n.Container.Name))})"; + var containerNames = GetContainerNames(); overviewLog.Log($"{containerNames} {testName}: {msg}"); } - private CodexAccess[] CreateRandomNodes(int number) + private string GetContainerNames() { - var containers = SelectRandomContainers(number); + if (handle.Test.RequiredNumberOfNodes == -1) return "(All Nodes)"; + return $"({string.Join(",", nodes.Select(n => n.Container.Name))})"; + } + + private CodexAccess[] CreateRandomNodes() + { + var containers = SelectRandomContainers(); fixtureLog.Log("Selected nodes: " + string.Join(",", containers.Select(c => c.Name))); return codexNodeFactory.Create(config, containers, fixtureLog, handle.Test.TimeSet); } - private RunningContainer[] SelectRandomContainers(int number) + private RunningContainer[] SelectRandomContainers() { + var number = handle.Test.RequiredNumberOfNodes; if (number == -1) return config.CodexDeployment.CodexContainers; var containers = config.CodexDeployment.CodexContainers.ToList();