Skip to content

Test which tags count as an event's own version or install - #33

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/test-own-version-install-tag-matching
Nov 8, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/test-own-version-install-tag-matching

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle: tests only, no production change. Four characterization tests pin down which tag counts as an event's own version or install, a rule the README states ("An event that passes its own version tag keeps it") without saying how a key is matched:

  • Report_AnEmptyVersionTagStillWinsOverTheProgramVersion: {"version": ""} is sent as is, and the program's version is not added. A null value is already covered and behaves differently (it is no tag at all).
  • Report_OnlyTheExactLowercaseVersionKeyCountsAsTheEventsOwn: Version and version are ordinary tags, and the program's version is still added. WithVersion compares keys with == and does not trim them.
  • Report_AnEmptyInstallTagStillWinsOverTheConfiguredId and Report_OnlyTheExactLowercaseInstallKeyCountsAsTheEventsOwn: the same two cases for WithInstall and the configured installation ID.

Each test drives a real client against StubServer and asserts the exact body after Close().

Triage notes

Test plan

  • Build workflow green on ubuntu-latest (net8.0)
  • Build workflow green on windows-latest (net8.0 + net48)
  • Expected bodies traced by hand through WithVersion → WithInstall → Json

dotnet could not be run in the dispatch sandbox, so local verification is UNVERIFIED and 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

An empty value is a tag and wins over the program's version or the
configured installation ID, unlike a null one. Keys are matched exactly:
"Version", "Install" or " version" are ordinary tags and do not displace
either.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (posted as a comment; it is not an independent review)

  • Scope: PASS. Only tests/TraceClient.Tests/TraceClientTest.cs (+32) and tests/TraceClient.Tests/InstallIdTest.cs (+27) change, and both are additive.
  • Tests-new: N/A. No public member is added.
  • Tests-fix: N/A. This is a characterization-only cycle with no production change. Each test asserts current behaviour, which was traced through WithVersion → WithInstall → Json.
  • Sibling structure: PASS. Each test sits beside the matching null-value test (Report_ANullVersionTagDoesNotDisplaceTheProgramVersion, Report_ANullInstallTagDoesNotDisplaceTheConfiguredId) and follows the Subject_Behaviour naming, the StubServer round trip and the exact-body assertion used there.
  • Sibling renames: N/A.
  • Docs: PASS. No documented behaviour changed. The README's "an event that passes its own version / install tag keeps it" is consistent with exact, ordinal key matching.
  • Issue resolution: N/A. There is no Closes, and the coverage gaps were found during triage.
  • CI: PASS. Run 42439771273 is green on ubuntu-latest (net8.0) and windows-latest (net8.0 + net48). Each leg reports Passed: 113, Total: 113, against 109 on main (run 42335804809), so all 4 new tests executed on all three targets.
  • No dependencies / single file / vendoring floor / never throws / bounded / env seam / version / opt-out contract: PASS. src/ is untouched.

One observation outside the diff, for the maintainer: tests/TraceClient.Tests/InstallIdTest.cs — an event can pass an empty install tag ("") to suppress the configured installation ID for that one event. This is consistent with "the event's own tag wins", and it is now pinned by Report_AnEmptyInstallTagStillWinsOverTheConfiguredId. Whether an empty value should win, rather than being treated like a null one, would be a contract question, related to #31. Nothing is changed here.

Local dotnet was unavailable in the dispatch sandbox (UNVERIFIED locally), so the CI matrix on head f0acaba serves as 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 fed0dba into main Nov 8, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/test-own-version-install-tag-matching branch November 8, 2026 02:46
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