Skip to content

Cover the line reader's escapes, comments and quoted switch - #16

Open
dmccoystephenson wants to merge 1 commit into
mainfrom
feature/test-line-reader-edges
Open

dmccoystephenson wants to merge 1 commit into
mainfrom
feature/test-line-reader-edges

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Stage B test expansion: the server-wide config line reader and the installId builder precondition. Only TraceClientTest.java is changed. Production code is untouched.

Summary

  • serverWideTags_doubleQuotedValuesUnescapeNewlineTabCarriageReturnAndBackslash: covers the \n, \t, \r, \\ and unknown-escape branches of scalar(), and confirms that single-quoted values do not unescape. Before this, only \" had a test.
  • serverWideTags_dropValuesThatOpenAnAnchorAliasTagOrFoldedScalar: covers the &, *, !, %, @, backtick and > indicators. Before this, only [, { and | had a test.
  • serverWideTags_aHashIsACommentOnlyAfterWhitespace: issue#13 stays whole, a tab before # starts a comment, a tab after the colon separates the value, and a tab-indented line under a space-indented block is skipped.
  • serverWideConfig_theSwitchIgnoresATrailingCommentAndLeadingIndent: enabled: false # ..., an indented enabled: outside tags:, and enabled :\tFALSE all disable.
  • serverWideConfig_aQuotedFalseDoesNotDisableYet: characterization. enabled: "false" currently leaves reporting on. This is filed as A quoted enabled: "false" in the server-wide config does not turn reporting off #15 (opt-out contract, needs a maintainer decision). The test pins today's behaviour and should be flipped by whatever PR resolves A quoted enabled: "false" in the server-wide config does not turn reporting off #15.
  • builder_rejectsAnOverlongInstallIdAndAcceptsOneAtTheLimit: the IllegalArgumentException message, and a 255-character ID with surrounding whitespace that is accepted after trimming.

Test plan

  • mvn -B verify locally (Java 21): Tests run: 72, Failures: 0, Errors: 0, Skipped: 0, and the 6 new tests appear in the surefire report
  • CI matrix build (8), build (17), build (21) green (the new tests use only Java 8 APIs)

Deferred issues

No tracking issue — gap found during triage.

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

Pins the double-quoted escapes, the YAML indicators that drop a value,
when a hash starts a comment, the enabled: line's tolerance of comments
and indent, and the overlong installId precondition. A quoted
enabled: "false" not disabling is characterized for #15.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (CI anchor green on the PR head: build (8), build (17), build (21) all pass, run 37757109192):

  • Scope: PASS. git diff --stat origin/main shows one file, TraceClientTest.java (+81, test code only).
  • Tests-new: PASS (n/a). No new public members. All six tests target existing, previously undriven branches of scalar(), parseServerWideConfig and Builder.installId.
  • Tests-fix: n/a. No production change. This is a characterization-only Stage B cycle.
  • Sibling structure: PASS. The new tests follow the subject_behaviourInPlainWords naming, sit next to their siblings (serverWideConfig_*, serverWideTags_*, installId_*), and use the tagsOf / parseServerWideConfig helpers the neighbouring tests use.
  • Sibling renames: n/a. Nothing renamed.
  • Docs: PASS. No behaviour changed, so no docs row moves. The README "Server-wide tags" bullets (quoting, # comments, rejected constructs) are consistent with what the new tests pin.
  • Issue resolution: n/a. No Closes. A quoted enabled: "false" in the server-wide config does not turn reporting off #15 was filed for the gap found and is referenced, not closed.
  • CI: PASS. All three matrix legs are green. Locally mvn -B verify reported Tests run: 72, Failures: 0, and the surefire report lists all 6 new tests.
  • No dependencies / Single file / Java 8: PASS. pom.xml is unchanged, git ls-files src/main still lists only TraceClient.java, and the build (8) leg is green.
  • Never throws / Non-blocking / Environment seam / Version agreement / Opt-out contract: PASS (unchanged). No production code was touched.

Judgment calls flagged for the reviewer:

  • src/test/java/software/stephenson/trace/TraceClientTest.java serverWideConfig_aQuotedFalseDoesNotDisableYet: the Yet suffix and the comment presume A quoted enabled: "false" in the server-wide config does not turn reporting off #15 will flip this assertion. If the maintainer decides to keep quoted values meaningful-as-strings, the test should be renamed and the comment dropped rather than flipped.
  • serverWideTags_aHashIsACommentOnlyAfterWhitespace pins that a tab-indented entry under a space-indented block is silently skipped. That is current, documented-by-Javadoc behaviour ("lines indented differently from its first entry"), but an operator mixing tabs and spaces could find it surprising.

Summary: test-only PR, CI green on all legs. No do-not-auto-merge path matched. A human merge is still required, because this dispatch is not authorized to merge.

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


drafted by Claude on behalf of Daniel Stephenson

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.

A quoted enabled: "false" in the server-wide config does not turn reporting off

1 participant