Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoctopusdeploy committed Dec 19, 2023
1 parent 67267b8 commit 937583f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ to text.
Or one of the common options:
--help Show detailed help for this command
");
--help Show detailed help for this command");
}

[Test]
Expand All @@ -176,8 +175,7 @@ to text.
Or one of the common options:
--help Show detailed help for this command
");
--help Show detailed help for this command");
}

[Test]
Expand Down Expand Up @@ -510,8 +508,7 @@ to text.
Or one of the common options:
--help Show detailed help for this command
");
--help Show detailed help for this command");
}

[Test]
Expand Down Expand Up @@ -616,8 +613,7 @@ public async Task ShowConfigurationCommandLooksSensibleToHumans(TentacleConfigur
""PortNumber"": 10933
}}
}}
}}
");
}}");
}
else
{
Expand Down Expand Up @@ -655,8 +651,7 @@ public async Task ShowConfigurationCommandLooksSensibleToHumans(TentacleConfigur
""PortNumber"": {clientAndTentacle.RunningTentacle.ServiceUri.Port}
}}
}}
}}
");
}}");
}

await Task.CompletedTask;
Expand Down Expand Up @@ -742,7 +737,34 @@ FileVersionInfo GetVersionInfo(TentacleConfigurationTestCase tentacleConfigurati
.WithEnvironmentVariables(environmentVariablesToRunTentacleWith)
.ExecuteAsync(CancellationToken));

return (result.ExitCode, output.ToString(), errorOut.ToString());
var allOutput = output.ToString();
var filteredOutput = new StringBuilder();

// We turn on TRACE logging for Tentacle so we can capture the verbose output for debugging.
// This interferes with these tests so we need to do a bit of filtering of the output.
foreach (var line in allOutput.Split(Environment.NewLine))
{
if (!line.StartsWith("[TRACE]") && !line.StartsWith("[DEBUG]"))
{
if (line.StartsWith("}["))
{
filteredOutput.AppendLine("}");
}
else if (line.StartsWith("["))
{
filteredOutput.AppendLine(line.Substring(8));
}
else
{
filteredOutput.AppendLine(line);
}
}
}

var filteredOutputString = filteredOutput.ToString();
filteredOutputString = filteredOutputString.TrimEnd(' ', '\r', '\n', ' ', '\r', '\n', ' ');

return (result.ExitCode, filteredOutputString, errorOut.ToString());
}

static string JsonFormattedPath(string path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void Emit(LogEvent logEvent)
var testName = TestContext.CurrentContext.Test.FullName;

if (!TraceLoggers.TryGetValue(testName, out var traceLogger))
throw new Exception($"Could not find trace logger for test '{testName}'");
return;

var output = new StringWriter();
if (logEvent.Properties.TryGetValue("SourceContext", out var sourceContext))
Expand Down

0 comments on commit 937583f

Please sign in to comment.