Skip to content

test: restore the validate parity test and close coverage gaps - #8

Merged
bengl merged 1 commit into
nodejs:mainfrom
bengl:bengl/parity-coverage
Oct 27, 2026
Merged

bengl merged 1 commit into
nodejs:mainfrom
bengl:bengl/parity-coverage

Conversation

@bengl

@bengl bengl commented Oct 26, 2026

Copy link
Copy Markdown
Member

Restores the parity test deferred from the initial port, and closes the coverage gaps left behind in the merged code.

The parity test: one shared battery of calls runs through lib/validate.js and through node's real internal validators and error constructors in a child under --expose-internals, and the outcomes must match down to the error messages. outOfRangeError is exported again so the battery can construct it. If core ever changes these message formats, this test catches the drift.

The coverage gaps:

  • IPv6 authorities and portless Host headers on the http client, covering the bracket parsing and both scheme-default ports, 80 and 443
  • the boolean, non-integer, and fallback arms of the OTLP attribute encoding
  • the non-2xx collector response warning

The undici origin's scheme-default port stays uncovered: reaching it requires binding port 80 or 443, which tests cannot do.

Overall the suite goes from 94.6% to 97.4% line coverage, and validate.js from 41% to 73% branch coverage.

The parity test deferred from the initial port is back: one shared
battery of calls runs through lib/validate.js and through node's real
internal validators and error constructors in a child under
--expose-internals, and the outcomes must match down to the messages.
outOfRangeError is exported again for the battery to construct.

The coverage gaps: IPv6 authorities and portless Host headers on the
http client (both scheme defaults, 80 and 443), the boolean, non-integer,
and fallback arms of the OTLP attribute encoding, and the non-2xx
collector response warning. The undici origin's scheme-default port stays
uncovered: reaching it requires binding port 80 or 443.

Signed-off-by: Bryan English <bryan@bryanenglish.com>
@bengl
bengl force-pushed the bengl/parity-coverage branch from cefef87 to 9d4e843 Compare October 26, 2026 19:07
@bengl
bengl marked this pull request as ready for review October 26, 2026 19:12
@bengl
bengl requested a review from a team October 26, 2026 19:15
@bengl
bengl merged commit 51b490a into nodejs:main Oct 27, 2026
3 checks passed
@bengl
bengl deleted the bengl/parity-coverage branch October 27, 2026 19:48
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.

3 participants