Repository navigation
Cover the JSON and environment branches no test reached - #1
Merged
Merged
Conversation
Infinite values, whole and negative values, an empty or fully skipped tag map, the application and tag-key length checks (including the 32-character cut in the reason), carriage return and the other control characters in Quote, and an environment that cannot be read. Tests only; they pin the current behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on the
Notes for the reviewer:
The one-pass self-review found nothing blocking. The PR is test-only and green on all three target/OS combinations. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) cycle: the open-issue backlog was empty at triage, so this PR adds characterization tests for branches of
TraceClientthat no existing test exercised. Tests only. No production code, docs, csproj or workflow is changed.New tests in
tests/TraceClient.Tests/TraceClientTest.cs:Json_OmitsAnInfiniteValueLikeNaN:+Infinity/-Infinitydrop thevaluefield (only NaN was covered before).Json_WritesWholeAndNegativeValuesInTheirShortestForm:42.0goes on the wire as42and-0.5as-0.5(the README example reports42.0).Json_OmitsTheTagsObjectWhenNoTagSurvives: an empty map, or one where every tag is skipped, sends no"tags"key.Json_RejectsAnApplicationLongerThanTheLimitButNotOneAtIt: theapplicationside of theMaxLengthcheck, which had no test.Json_RejectsATagKeyLongerThanTheLimitAndNamesOnlyItsStart: the tag key length check (only the value side was tested), plus the 32-character cut in the logged reason.Quote_EscapesCarriageReturnAndEveryOtherControlCharacter:\r,\u0000,\u001f, and non-ASCII passed through unescaped.EnvironmentDisables_IsFalseWhenTheEnvironmentCannotBeRead: a throwingEnvironmentSource(e.g.SecurityExceptionin a sandbox) yieldsfalseand leaves an enabled client. This covers thecatchinEnvironmentDisables.All the new tests call
Json/Quote/EnvironmentDisablesdirectly or build an enabled client against the sharedStubServer. They don't depend on timing and use no new APIs outside what net48 provides.Verification
dotnetSDK is installed in the dispatch sandbox, so the suite could not be run locally. TheBuildworkflow matrix on this PR head (ubuntu-latest net8.0, windows-latest net8.0 + net48) is the gate.Test plan
Build/ ubuntu-latest (net8.0) greenBuild/ windows-latest (net8.0 + net48) greenDeferred
The issue backlog was empty at triage, so nothing was deferred.
No tracking issue: the gaps were found during triage by reading
TraceClient.csbranch by branch against the test file.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson