Skip to content

Cover the tag-merge helpers and the first enabled: line - #14

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/tag-merge-tests
Oct 7, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/tag-merge-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

This is a Stage B (unit-test expansion) cycle. The issue backlog was empty at triage, so no issues were deferred. The change is test-only: TraceClient.java is untouched.

Four tests are added for branches that had no direct test:

  • withVersion_dropsNullKeysAndValuesAndKeepsTheEventsOwnVersion: null keys and values are dropped from the copy, an event's own version is kept, and the caller's map is left unmodified.
  • withVersion_addsTheVersionEvenToAnEventAlreadyAtMaxTags: a characterization test. Current behaviour is pinned: an event with MAX_TAGS tags of its own goes out with MAX_TAGS + 1. This looks like a bug and is filed as withVersion pushes an event already at MAX_TAGS over the server's tag limit #13. Production code is deliberately left unchanged, because fixing it alters what is sent on the wire and that is a maintainer decision. When withVersion pushes an event already at MAX_TAGS over the server's tag limit #13 is resolved, this test is expected to be updated.
  • withInstall_addsTheIdOnlyWhenThereIsOneAndRoomAndNoneAlready: covers all four outcomes, which are added, no ID, the event's own install wins, and already at MAX_TAGS. It also checks that the caller's map is not modified.
  • serverWideConfig_theFirstEnabledLineIsTheSwitch: the first enabled: line decides, and a commented-out line does not count.

No tracking issue exists for the coverage itself; the gaps were found during triage.

Test plan

  • mvn -B verify run locally on JDK 21: Tests run: 66, Failures: 0, Errors: 0, Skipped: 0 (62 before, plus 4)
  • CI matrix (Java 8, 17, 21) green on the PR head

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

withVersion's null-dropping and own-version branches, withInstall's
four outcomes, and the rule that the first enabled: line is the switch
had no direct test. One test characterizes withVersion adding a tag to
an event already at MAX_TAGS, which #13 questions.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (performed inline in the same session, so it is not an independent review):

  • Scope: PASS. git diff --stat origin/main shows only TraceClientTest.java, +72/-0. No production code is touched.
  • Tests-new: PASS. No new public members. The 4 new tests cover withVersion, withInstall and parseServerWideConfig branches that had no direct test.
  • Tests-fix: N/A. This is not a bug fix. The suspected bug is filed as withVersion pushes an event already at MAX_TAGS over the server's tag limit #13 and only characterized here.
  • Sibling structure / renames: PASS. The tests follow the subject_behaviour naming and Arrange/Act/Assert comments. Nothing is renamed.
  • Docs: PASS. No behaviour changed, so no README or Javadoc row is affected.
  • Issue resolution: N/A. There is no Closes. withVersion pushes an event already at MAX_TAGS over the server's tag limit #13 is referenced but deliberately left open.
  • CI: PASS. build (8), build (17) and build (21) all pass on the PR head (run 37429266363). Locally: Tests run: 66, Failures: 0, Errors: 0, Skipped: 0.
  • No dependencies / single file / Java 8: PASS. pom.xml is untouched. git ls-files src/main lists only TraceClient.java. The new tests use only Java 8 APIs (LinkedHashMap, Collections.singletonMap, Arrays.asList), and the Java 8 leg is green.
  • Never throws / non-blocking / env seam / version / opt-out contract: PASS (not applicable). No production code changed.

Findings (judgment calls, not blocking):

Merge-gate note: no do-not-auto-merge path is modified. This dispatch is not authorized to merge, so the PR is left open for human review.

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 f5d567e into main Oct 7, 2026
3 checks 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.

1 participant