Skip to content

Test that a blank name is never mentioned to the Logger - #32

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/blank-name-logger-test
Nov 12, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/blank-name-logger-test

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • aBlankNameIsNeverMentionedToTheLogger is added to test/test_trace_client.cpp and registered in main()'s tests[] table.
  • The README ("What report promises" → "Fits the server's limits") states that a report whose name is empty or blank "is ignored, without a mention to the Logger". Only the first half of that promise was asserted: reportIgnoresABlankName checks that nothing reaches the server, but no Logger is attached in it.
  • In the new test, blank names are passed through all three report overloads (name; name + tags; name + value + tags), using every ASCII space character, followed by one real report to a stub server answering 500. Exactly one Logger line is expected — the answered 500 drop for startup — which shows the Logger was listening and that nothing was produced for the blank names.
  • Characterization only: no production code is changed.

This is a Stage B (unit-test expansion) cycle. A Stage A documentation sweep was run first, with README.md checked against trace_client.hpp, Makefile, CMakeLists.txt and .github/workflows/build.yml; no drift was found beyond what the two open issues already track.

Deferred issues

No tracking issue — gap found during triage.

Test plan

  • make test (g++, C++11, -Wall -Wextra -pedantic -Werror): 75 tests, 0 failed checks (74 on main, plus the one added here)
  • CI Build: linux (g++/clang++ × c++11/17/20), linux-libcurl, linux-sanitizers (thread; address,undefined), macos, windows. clang++ is not installed locally, so CI is relied on for that compiler.

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

The README promises a report with an empty or blank name is ignored
"without a mention to the Logger", but reportIgnoresABlankName attaches
no Logger. The new test sends blank names through every report
overload alongside one real report to a server answering 500, so the
Logger is seen to be listening and hears only that one drop.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (scored against CI run 43152682886 on the PR head and the diff):

  • Scope: PASS — the only file changed is test/test_trace_client.cpp: one new test function plus its tests[] entry. No production, doc or build file is touched.
  • Tests-new: PASS — no new public method or function is added; the new test covers an existing README promise that had no assertion.
  • Tests-fix: N/A — this is not a bug fix. It is a characterization test of current behavior, so no stash-and-run is required. The test still discriminates: if enqueue mentioned a blank name to the Logger, log.lines.size() would be greater than 1 and CHECK_EQ(1u, log.lines.size()) would fail.
  • Sibling structure: PASS — the test follows the neighboring tests (static void sentence-named function, StubServer, Log, CHECK_EQ). It is placed directly after reportIgnoresABlankName, and its table entry is in the matching position.
  • Sibling renames: N/A — nothing is renamed.
  • Docs: PASS — no behavior changed, so no documentation needed updating. A Stage A sweep of README.md against trace_client.hpp, Makefile, CMakeLists.txt and build.yml found no drift beyond what TRACE_CLIENT_CURL override is ignored on Windows when System32\curl.exe exists #1 and The version tag is dropped when an event's own tags fill the 32-tag cap #21 already track.
  • Issue resolution: N/A — no Closes #N. The gap was found during triage.
  • CI: PASS — all 11 jobs are green: linux g++/clang++ × c++11/17/20, linux-libcurl, linux-sanitizers (thread; address,undefined), macos, windows.
  • Registered: PASS — aBlankNameIsNeverMentionedToTheLogger appears twice in the file (definition plus tests[]). The local run printed 75 tests, 0 failed checks, up from 74 on main.
  • C++11: PASS — the local make test (g++, STD=c++11, -Werror) built clean, and both CI c++11 legs are green.
  • No new dependency / Never throws / Curl argv fixed / Version triple: N/A — trace_client.hpp, Makefile and CMakeLists.txt are untouched.
  • Sanitizers: PASS — the thread and address,undefined jobs are both green.

Observation, for judgment: test/test_trace_client.cpp:806 — log.lines.size() is read without Log::mutex. This is safe: close() returned after done was set and the sending thread was joined, so no thread can still be writing to the log. The ThreadSanitizer job agrees. The read is left as is rather than adding a locked accessor to the shared helper for a single call site.

Summary: this PR adds test coverage only. It is green on every platform job, and no path on the do-not-auto-merge list is touched.

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 85c2503 into main Nov 12, 2026
11 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/blank-name-logger-test branch November 12, 2026 04:08
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