Repository navigation
Test the client's untested fallback and failure branches - #2
Merged
Merged
Conversation
Characterization tests only; trace-client.ts is unchanged. Covers the timeoutMs fallback, serialize()'s tag cleaning and its failure path, any 2xx and an unreadable body counting as delivered, describe() naming an Error's cause, bounded() with a negative or non-finite timeout, the constructor naming the bad argument, and pagePath() on a non-string or an unparseable absolute URL. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on CI run 35968520940 on this head:
Findings:
This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A unit-test expansion cycle (Stage B). It adds characterization tests for branches of
trace-client.tsthat no test covered before.trace-client.tsitself is unchanged.timeoutMsfallback:0,-1,NaNandInfinityfall back toTraceClient.TIMEOUT_MS. A stubfetchchecks that the request's signal has not aborted after 100 ms. If any of those values were used as-is, the request would abort.throws mentionbaseUrl/application, including for non-string input.serialize()tag cleaning:null/undefinedtag values are dropped and other values are coerced to strings. Atagsobject left empty is omitted.±Infinityvalues are omitted, andvalue: 0is kept, which guards against a falsy check.report()serialize-failure path: a tag whosetoString()throws is logged ascould not serialize <name>. The call resolves and nothing is sent.send()success paths: a202counts as delivered, and so does a2xxwhose body can't be read. Neither produces a debug line.describe(): anErrorwith acauseis logged asError: <message> (<cause message>), and a non-Error rejection is logged viaString().bounded():flush()andclose()given-1,NaNorInfinityreturn promptly and don't wait on a hung request.pagePath(): a non-string input or an unparseable absolute URL (http://[not-a-host/...) returns/.No test showed a bug. Every assertion matches the code's current behavior as read from
trace-client.ts.No tracking issue: when this cycle started, the repo had no open issues. The gap was found during triage using the dev loop's Stage B checklist. A documentation sweep of README, CHANGELOG and TSDoc against
trace-client.tswas done first and found no drift, so this cycle expands the tests instead.Test plan
testjob on this head:npm ci,npm run typecheck,npm teston Node 22 (run 35968520940 on5b2f341:# tests 40,# pass 40,# fail 0)tests/trace-client.test.tschanged. Its new imports are none. It uses only the existingnode:*imports and../trace-client.ts.The local anchor is UNVERIFIED. Node isn't installed in the environment that drafted this PR, so the suite couldn't be run locally. The CI check on this PR's head SHA is the verification.
Cross-client parity and changelog
CHANGELOG.md: no entry, because nothing changes for users. Only tests were added.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