Skip to content

Test a blank key's disabled reason and an empty install ID file - #35

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/test-blank-key-and-empty-install-file
Nov 12, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/test-blank-key-and-empty-install-file

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Stage B (unit-test expansion) cycle: two promises made in the README are given tests of their own. No production code is changed.

  • DisabledReason_TreatsABlankKeyAsNoKey: the "Turning it off" table says "No key, or a blank one" yields no key. A blank key was previously checked only for sending nothing (DisabledClient_SendsNothing), never for the reason a program prints. Covers "", spaces, and "\t\n".
  • InstallIdFromFile_ReplacesAnEmptyOrBlankFileWithAFreshId: the README says a file that "holds no such line" gets a new random ID. The existing test covered a file of junk lines; a zero-byte or whitespace-only file (touched by hand, or cut off mid-write) had no test. The fresh ID is asserted to be written and reused.

No tracking issue — gaps found during triage.

Test plan

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

The local dotnet SDK was not available in the dispatch sandbox, so the CI matrix on the PR head is the test anchor.

Skipped issues

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 that a blank key disables reporting with the reason
"no key", and that an install ID file holding no valid line is replaced
with a fresh ID. Neither case had a test of its own: a blank key was
only checked for sending nothing, and the replaced file held junk lines
rather than nothing at all.

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

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 43143171274):

  • Scope: PASS. Two test files, +30 lines, no deletions; no production code, csproj or docs touched.
  • Tests-new: PASS (not applicable). No new public member; the PR only adds tests.
  • Tests-fix: not applicable. No bug fix. Both tests describe current behaviour and passed first time.
  • Sibling structure: PASS. The tests sit next to their neighbours (DisabledReason_NamesTheConfigFlagOrTheMissingKey, InstallIdFromFile_ReadsTheFirstValidLineAndReplacesAFileWithoutOne), use the Subject_Behaviour naming, the _server / _directory fixtures and the IsGuid helper.
  • Sibling renames: not applicable.
  • Docs: PASS. The README "Turning it off" row ("No key, or a blank one") and the install ID text ("holds no such line") already describe what these tests assert.
  • Issue resolution: not applicable. There is no Closes; the gaps were found during triage.
  • CI: PASS. Both legs are green. The net8.0 and net48 summaries each show Passed: 119, Total: 119, up from 114 on main (42948749670): 3 + 2 new theory cases on every target.
  • No dependencies / Single file / Vendoring floor / Never throws / Non-blocking / Environment seam / Version / Opt-out contract: PASS. src/ is untouched.

Judgment note: the empty-file test writes into a fresh per-test temp directory and is cleaned up by the fixture's Dispose. It has no timing assertions, so it carries no flake risk on the Windows runner.

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 144a831 into main Nov 12, 2026
2 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/test-blank-key-and-empty-install-file branch November 12, 2026 02:44
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