Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/SeqCli/Cli/Commands/Node/HealthCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ protected override async Task<int> Run()
try
{
var response = await connection.Client.HttpClient.GetAsync("health");
Console.WriteLine($"HTTP {response.Version} {((int)response.StatusCode).ToString(CultureInfo.InvariantCulture)} {response.ReasonPhrase}");
Log.Information("HTTP {HttpVersion} {StatusCode} {ReasonPhrase}", response.Version, (int)response.StatusCode, response.ReasonPhrase);

foreach (var (key, values) in response.Headers.Concat(response.Content.Headers))
foreach (var value in values)
{
Console.WriteLine($"{key}: {value}");
Log.Information("{HeaderName}: {HeaderValue}", key, value);
}

Console.WriteLine(await response.Content.ReadAsStringAsync());

return response.IsSuccessStatusCode ? 0 : 1;
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion test/SeqCli.EndToEnd/Node/NodeDemoteTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace SeqCli.EndToEnd.Node;

[CliTestCase(MinimumApiVersion = "2021.3.6410")]
[CliTestCase]
public class NodeDemoteTestCase: ICliTestCase
{
public Task ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner)
Expand Down
4 changes: 2 additions & 2 deletions test/SeqCli.EndToEnd/Node/NodeHealthTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

namespace SeqCli.EndToEnd.Node;

[CliTestCase(MinimumApiVersion = "2021.3.6410")]
[CliTestCase]
public class NodeHealthTestCase: ICliTestCase
{
public Task ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner)
{
var exit = runner.Exec("node health");
Assert.Equal(0, exit);
Assert.StartsWith("HTTP 1.1 200 OK", runner.LastRunProcess!.Output);
Assert.StartsWith("{\"status\":", runner.LastRunProcess!.Output);
return Task.CompletedTask;
}
}
2 changes: 1 addition & 1 deletion test/SeqCli.EndToEnd/Node/NodeListTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace SeqCli.EndToEnd.Node;

[CliTestCase(MinimumApiVersion = "2021.3.6410")]
[CliTestCase]
public class NodeListTestCase: ICliTestCase
{
public Task ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner)
Expand Down