From 6a2bd11dd54d633523598667b788a0693f9d64b1 Mon Sep 17 00:00:00 2001 From: benbierens Date: Wed, 27 Sep 2023 09:09:42 +0200 Subject: [PATCH] Adds codex environment variables to startup log of continuous tests. --- Framework/KubernetesWorkflow/ContainerRecipe.cs | 7 ++++++- Tests/CodexContinuousTests/StartupChecker.cs | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Framework/KubernetesWorkflow/ContainerRecipe.cs b/Framework/KubernetesWorkflow/ContainerRecipe.cs index 215b228..772ff20 100644 --- a/Framework/KubernetesWorkflow/ContainerRecipe.cs +++ b/Framework/KubernetesWorkflow/ContainerRecipe.cs @@ -49,7 +49,7 @@ return $"(container-recipe: {Name}, image: {Image}, " + $"exposedPorts: {string.Join(",", ExposedPorts.Select(p => p.Number))}, " + $"internalPorts: {string.Join(",", InternalPorts.Select(p => p.Number))}, " + - $"envVars: {string.Join(",", EnvVars.Select(v => v.Name + ":" + v.Value))}, " + + $"envVars: {string.Join(",", EnvVars.Select(v => v.ToString()))}, " + $"limits: {Resources}, " + $"volumes: {string.Join(",", Volumes.Select(v => $"'{v.MountPath}'"))}"; } @@ -77,6 +77,11 @@ public string Name { get; } public string Value { get; } + + public override string ToString() + { + return $"'{Name}' = '{Value}'"; + } } public class VolumeMount diff --git a/Tests/CodexContinuousTests/StartupChecker.cs b/Tests/CodexContinuousTests/StartupChecker.cs index e90f93d..07ae67f 100644 --- a/Tests/CodexContinuousTests/StartupChecker.cs +++ b/Tests/CodexContinuousTests/StartupChecker.cs @@ -24,6 +24,7 @@ namespace ContinuousTests { var log = new FixtureLog(new LogConfig(config.LogPath, false), DateTime.UtcNow, "StartupChecks"); log.Log("Starting continuous test run..."); + IncludeDeploymentConfiguration(log); log.Log("Checking configuration..."); PreflightCheck(config); log.Log("Contacting Codex nodes..."); @@ -33,6 +34,20 @@ namespace ContinuousTests public List LogReplacements { get; } + private void IncludeDeploymentConfiguration(ILog log) + { + log.Log(""); + var deployment = config.CodexDeployment; + foreach (var container in deployment.CodexContainers) + { + log.Log($"Codex environment variables for '{container.Name}':"); + var codexVars = container.Recipe.EnvVars; + foreach (var vars in codexVars) log.Log(vars.ToString()); + log.Log(""); + } + log.Log(""); + } + private void PreflightCheck(Configuration config) { var tests = testFactory.CreateTests();