Adds codex environment variables to startup log of continuous tests.

This commit is contained in:
benbierens 2023-09-27 09:09:42 +02:00
parent d830ccb48e
commit 6a2bd11dd5
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 21 additions and 1 deletions

View File

@ -49,7 +49,7 @@
return $"(container-recipe: {Name}, image: {Image}, " + return $"(container-recipe: {Name}, image: {Image}, " +
$"exposedPorts: {string.Join(",", ExposedPorts.Select(p => p.Number))}, " + $"exposedPorts: {string.Join(",", ExposedPorts.Select(p => p.Number))}, " +
$"internalPorts: {string.Join(",", InternalPorts.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}, " + $"limits: {Resources}, " +
$"volumes: {string.Join(",", Volumes.Select(v => $"'{v.MountPath}'"))}"; $"volumes: {string.Join(",", Volumes.Select(v => $"'{v.MountPath}'"))}";
} }
@ -77,6 +77,11 @@
public string Name { get; } public string Name { get; }
public string Value { get; } public string Value { get; }
public override string ToString()
{
return $"'{Name}' = '{Value}'";
}
} }
public class VolumeMount public class VolumeMount

View File

@ -24,6 +24,7 @@ namespace ContinuousTests
{ {
var log = new FixtureLog(new LogConfig(config.LogPath, false), DateTime.UtcNow, "StartupChecks"); var log = new FixtureLog(new LogConfig(config.LogPath, false), DateTime.UtcNow, "StartupChecks");
log.Log("Starting continuous test run..."); log.Log("Starting continuous test run...");
IncludeDeploymentConfiguration(log);
log.Log("Checking configuration..."); log.Log("Checking configuration...");
PreflightCheck(config); PreflightCheck(config);
log.Log("Contacting Codex nodes..."); log.Log("Contacting Codex nodes...");
@ -33,6 +34,20 @@ namespace ContinuousTests
public List<BaseLogStringReplacement> LogReplacements { get; } public List<BaseLogStringReplacement> 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) private void PreflightCheck(Configuration config)
{ {
var tests = testFactory.CreateTests(); var tests = testFactory.CreateTests();