Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only include detailed HTTP diagnostics in node health output when --verbose is set #358

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Jul 8, 2024

No --verbose flag - parseable JSON:

> seqcli -- node health
{"status":"The Seq node is in service."}

With the flag (similar output to today):

> seqcli node health --verbose
HTTP 1.1 200 OK
Date: Mon, 08 Jul 2024 04:16:13 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
...
{"status":"The Seq node is in service."}

No --json flag is currently required - the output is always the literal response from the server, for easy diagnostics (e.g. when the actual response is some random HTML page from a proxy/gateway). Could reevaluate this down the track.

@KodrAus
Copy link
Member

KodrAus commented Jul 9, 2024

RUNNING NodeHealthTestCase                                
{"status": "The Seq node is in service."}
FAIL
Xunit.Sdk.StartsWithException: Assert.StartsWith() Failure: String start does not match
String:         "{"status": "The Seq node is in service."}"···
Expected start: "HTTP 1.1 200 OK"
   at Xunit.Assert.StartsWith(String expectedStartString, String actualString, StringComparison comparisonType) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 899
   at Xunit.Assert.StartsWith(String expectedStartString, String actualString) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 879
   at SeqCli.EndToEnd.Node.NodeHealthTestCase.ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner) in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Node/NodeHealthTestCase.cs:line 16
   at SeqCli.EndToEnd.Support.IsolatedTestCase.ExecuteTestCaseAsync() in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Support/IsolatedTestCase.cs:line 66
   at SeqCli.EndToEnd.Support.TestDriver.Run() in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Support/TestDriver.cs:line 52

@nblumhardt nblumhardt merged commit 13c8ae8 into datalust:dev Jul 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants