Repository navigation
test(schema): every BitField namespace covers all of its bits - #1416
Merged
Merged
Conversation
Walk every schema under pcapkit.protocols.schema and assert each BitField names its full width exactly once. ForwardMatchField-wrapped peeks are exempt (they pack no octets). Discovery is cross-checked against the BitField(...) call count per module. The 27 remaining HIP and MH gaps are an explicit KNOWN_GAPS allowlist, matched exactly so a fixed site must drop its entry. Closes #1288
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.43% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 8, 2026
Merged
JarryShaw
added a commit
that referenced
this pull request
Oct 8, 2026
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.
make pylint,make mypy,make isort) — isort clean; pylint only flags the mandated in-test imports; mypy not runmake testpasses, and a test case covers the change — legs belowdocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
test— tests onlyDescription of your pull request and other information
Refs #1288 (which closes once
KNOWN_GAPSis empty; HIP is #1417, MH is #1418). Newtests/protocols/schema/test_bitfield_coverage_unit.pywalks all 104BitFields underpcapkit/protocols/schema/and asserts each namespace covers its width with no gap and no overlap. Discovery is cross-checked against theBitField(...)call count per module (AST).ForwardMatchField-wrapped peeks (Quick-Start in hopopt/ipv6_opts/ipv4, SMF-DPD in hopopt/ipv6_opts, MH CGA, TCP MPTCP, PCAP-NG SHBmatch) are exempt by construction: they pack no octets.KNOWN_GAPSallowlist: HIP 3 (HIP.verbits 4-6,RouteDst/RouteViaParameter.flagsbits 2-15) and MH 24. Each fix needs the protocol reader, data model andmake(), not just the schema, so they want their own PRs.'reserved': (0, 4)from SCTPDATAChunk.flagsfails the test with'transport.sctp.DATAChunk.flags': ((0, 4),).Tests: new module 3 passed / 105 subtests;
run_unittest_leg.py protocols/internet566 OK;protocols --exclude protocols/internet1056 OK.