Skip to content

Test a blank explicit install ID falling back to the file and a padded DO_NOT_TRACK - #16

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/blank-install-id-and-dnt-trim-tests
Oct 22, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/blank-install-id-and-dnt-trim-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle: two characterization tests are added for constructor and opt-out behaviour that had no test. No production code is changed.

  • InstallIdTest.BlankExplicitId_DoesNotWinOverTheFile: a blank installId (" ") passed alongside an installIdFile is treated as none, so the file is still created, its GUID becomes InstallId, and that ID is sent as the install tag. This pins the constructor's !string.IsNullOrEmpty(explicitInstallId) → installIdFile fallthrough (src/TraceClient/TraceClient.cs:208-215). The existing NoIdOrABlankOne_SendsNoInstallTag covers only the case where both are blank.
  • TraceClientTest.DoNotTrack_DisablesReportingForEveryAcceptedValue gains [InlineData(" Yes ")]. IsYes trims and lower-cases its input, and the TRACE_USAGE_REPORTING theory already checks " No ", but DO_NOT_TRACK had no padded or mixed-case case. The README "Turning it off" table promises case-insensitivity for both variables.

No tracking issue: the gaps were found during triage by reading TraceClient.cs branch by branch against both test files.

Skipped: #12 (non-ASCII application in User-Agent). It changes the wire format and needs Java and Python parity, so the maintainer has to decide it (behaviour-contract change, not auto-fixable).

Test plan

  • Build workflow green on ubuntu-latest (net8.0)
  • Build workflow green on windows-latest (net8.0 + net48)

Local run: UNVERIFIED, because no dotnet SDK is installed in the dispatch sandbox. The CI matrix on the PR head is the gate.

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

…d DO_NOT_TRACK

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 39743643018 on the PR head):

  • Scope: PASS. Only tests/TraceClient.Tests/InstallIdTest.cs (+18) and tests/TraceClient.Tests/TraceClientTest.cs (+1) are modified. Both changes are test additions within the Stage B target.
  • Tests-new: PASS (n/a). No public member is added.
  • Tests-fix: n/a. No bug fix; these are characterization tests of current behaviour.
  • Sibling structure: PASS. The new [Fact] follows the shape of ExplicitId_IsTrimmedWinsOverTheFileAndWritesNothing directly above it: the shared _server and _directory fixtures, the IsGuid helper, and an exact body assertion.
  • Sibling renames: n/a.
  • Docs: PASS. No behaviour changed. The README "Turning it off" table already promises case-insensitive DO_NOT_TRACK, and the constructor XML doc already says a blank installId "means none".
  • Issue resolution: n/a. No Closes. The gaps were found during triage.
  • CI: PASS. Both legs are green: ubuntu-latest net8.0 83/83, windows-latest net8.0 83/83 and net48 83/83. The latest main run (39561865026) reported 81, so both new test cases executed on every leg.
  • No dependencies / Single file / Vendoring floor / Never throws / Non-blocking / Environment seam / Version / Opt-out contract: PASS (untouched). src/ is not in the diff.

Observation (judgment, not a defect): the installId param doc says "null or blank means none ... Wins over installIdFile". A reader could take this to mean a blank installId also suppresses the file. The new test pins the actual behaviour: blank falls through to the file. The README sentence "installId: wins over installIdFile:" and the // null or blank: none sent comment in the explicit-ID example are accurate only when no file is also given. A wording tweak could be considered in a later docs cycle, but it is not changed here.

Local run: UNVERIFIED (no dotnet SDK in the dispatch sandbox). The CI matrix on the exact head SHA is the anchor.

This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 09ac469 into main Oct 22, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/blank-install-id-and-dnt-trim-tests branch October 22, 2026 07:55
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.

1 participant