test: refresh fixtures for canboat 8.0.0 and require ts-pgns 2.0.0 - #455
Draft
keesverruijt wants to merge 4 commits into
Draft
test: refresh fixtures for canboat 8.0.0 and require ts-pgns 2.0.0#455keesverruijt wants to merge 4 commits into
keesverruijt wants to merge 4 commits into
Conversation
canboat #792 decodes the 4 reserved bits after Status in each PGN 129540 satellite record as a GNSS System lookup (GPS/GLONASS/Galileo/BeiDou/QZSS), so the parser now emits gnssSystem where it used to emit reserved11. The device in these fixtures leaves the nibble at 0xF (unavailable), so the value is null either way -- only the key changes. Requires @canboat/ts-pgns built from canboat >= 8.0.0-beta1. Against the currently published ts-pgns (canboat 6.2.0) this fixture fails, so it must land after ts-pgns publishes from canboat 8.x.
canboat reworked PGN 130845 between 6.2.x and 7.1.0; the fixtures still described the old field set. displayGroup is now networkGroup, minlength is now operation, and repeatIndicator/reserved7/spare9 are gone in favour of instance and source. The bytes are unchanged -- only the field names and shape moved. The encode direction previously wrote 0xff at offset 9 because the stale fixture had no field for that byte; with operation: 'Set' present it round-trips to the original 01 exactly, so this was fixture drift and not an encoder bug. Verified against ts-pgns built from canboat 8.0.0-beta1: full suite green, 136 jest + 192 mocha, and npm run ci-lint clean.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
canboat 8.0.0 appends a trailing Sequence ID to the three AIS PGNs (129039, 129793 -- which also gains spare15 and reserved16 -- and 129794), and names the Maretron annunciator fields that 130824 carried as field4, field5, field6 and field8: annunciatorInstance, annunciatorState, pattern and alertId. Three of these captures are shorter than the definition they now decode against, which is what canboat records as MinLength: the device was built against the earlier layout and stops transmitting where that layout ended. Decoding accepts them unchanged, but encoding always writes the full definition, so a fixture can now name the frame it re-encodes to in `encoded` -- 129793 (36 -> 39 bytes), 129794 (75 -> 76) and the 130850 NoDrift command (11 -> 12). The recorded capture stays the decode input. 136 jest + 192 mocha pass, 0 failing, against ts-pgns built from canboat 8.0.0. ci-lint clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The fixtures on this branch decode against canboat 8.0.0, which ts-pgns publishes as 2.0.0 -- a major, because canboat corrected 78 MANUFACTURER_CODE names and dropped 8 duplicate codes. ^1.11.9 would still resolve the published 1.11.18 and its canboat 6.2.0 definitions. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Brings the fixtures up to canboat 8.0.0 (released 2026-08-25), which reaches canboatjs through ts-pgns 2.0.0. No library code needed changing: the decoder already reads to end-of-data, so the newly authored
MinLengthcosts it nothing, and no source file referenced a manufacturer name that 8.0.0 renamed or dropped.Field renames and additions
test/pgns/129540.js—reserved11→gnssSystem(30 occurrences). canboat #792 decodes the 4 bits afterStatusin each satellite record as a GNSS System lookup. The device in these fixtures leaves the nibble at0xF(unavailable), so the value isnulleither way — only the key changes.test/pgns/130845.js— refreshed for the layout canboat adopted between 6.2.x and 7.1.0:displayGroup→networkGroup,minlength→operation, andrepeatIndicator/reserved7/spare9replaced byinstance/source. The encode direction previously wrote0xffat offset 9 because the stale fixture had no field for that byte; withoperation: 'Set'present it round-trips to the original01exactly. Fixture drift, not an encoder bug.test/pgns/129039.js,129793.js,129794.js— 8.0.0 gives all three AIS PGNs their trailing Sequence ID; 129793 also gainsspare15andreserved16.test/pgns/130824.js— the Maretron annunciator fields are named now:field4/field5/field6/field8→annunciatorInstance/annunciatorState/pattern/alertId.Short captures — the new
encodedfixture keyThree of these captures are shorter than the definition they now decode against. That is exactly what canboat 8.0.0 records as
MinLength: the device was built against the earlier layout and stops transmitting where that layout ended.Decoding accepts them unchanged. Encoding always writes the full definition, so the round-trip no longer reproduces the recorded frame — by design, not by defect. A fixture can now name the frame it re-encodes to in
encoded, leaving the real capture as the decode input:test/test.jsreadstest.encoded || test.inputin the encode direction; every other fixture is untouched.package.json@canboat/ts-pgns^1.11.9→^2.0.0. The old range still resolves the published 1.11.18 and its canboat 6.2.0 definitions, against which these fixtures fail by design.Note on 130850 — decode side unchanged
mastercurrently fails 4× on 130850 against the published ts-pgns, and "Node.js CI & Test" has been red since the #447 merge on 2026-06-29. That is not a canboatjs defect: those fixtures are already correct for canboat 7.x/8.x and only fail against the older published package. Three of the four pass here unmodified; the fourth is the NoDrift short capture above, which needed theencodedkey rather than a fixture rewrite.(Closed PR #448 attempted these same 130850 fixtures from the other direction.)
Verification
Built ts-pgns from canboat 8.0.0 and linked it in:
npm run ci-lintclean (eslint +prettier --check lib test).🤖 Generated with Claude Code