Skip to content

test(dispatch): keep the KNOWN_DEGRADED copies in step and drop stale stand-ins (#2229) - #2239

Merged
JarryShaw merged 1 commit into
mainfrom
test/2229-known-degraded
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
test/2229-known-degraded

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • test — tests only

Description

Closes #2229.

  • Sync test: DispatchRegistryTests.test_known_degraded_matches_the_generator reads examples/generators/dispatch.py's table through the existing _load_generator. It asserts the two KNOWN_DEGRADED copies agree on labels, fragments and reasons. The generator's reason strings are aligned to the test's.
  • NGAP comment: CI installs [NGAP] and reports the malformed-PDU reason. A local run without pycrate reports the missing-dependency reason.
  • Stand-ins: both IPX cases send bytes(IPX()), and the HIP case sends one Parameter.SEQ.
    • link/Novell_Inc_0x8137: Ethernet:IPX:Unknown becomes Ethernet:IPX.
    • internet/IPX_in_IP: becomes Ethernet:IPv4:IPX.
    • HIP: still Ethernet:IPv6:HIPv2:TCP.
    • The generator's summary line is unchanged.
  • Fail-without-fix: against origin/main's generator, 2 failed ("the fragment or reason recorded here differs from examples/generators/dispatch.py"). Changing one fragment fails it again.
  • Tests run: test_dispatch_registry_unit gives 8 passed. The generator project tests, tier guard and docstring contract give 145 passed.

… stand-ins (#2229)

Problem: examples/generators/dispatch.py and DispatchRegistryTests each keep
a KNOWN_DEGRADED table, nothing held them together, and their reason strings
had drifted. The NGAP comment claimed CI omits [NGAP], and the probe still
sent zero-octet IPX stand-ins and two HIP parameters.

Fix: align the reason strings, reword the NGAP comment, build both IPX
payloads with bytes(IPX()) and send one HIP parameter. IPX now dispatches as
Ethernet:IPX and Ethernet:IPv4:IPX, and HIP still reaches HIPv2.

Test: test_known_degraded_matches_the_generator compares labels, fragments
and reasons of the two copies; it fails on origin/main's diverging reasons.
@JarryShaw JarryShaw added test Pull requests that add or correct tests (test: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at 116970d61 (Sonnet).

  • Probe: link/Novell_Inc_0x8137 gives Ethernet:IPX, internet/IPX_in_IP gives Ethernet:IPv4:IPX, and HIP gives Ethernet:IPv6:HIPv2:TCP. The summary line is unchanged.
  • Sync test: it fails against main's generator, on a changed reason, on a dropped fragment and on a renamed label.
  • NGAP comment: true. The NGAP-carrying installs are test, unittest-ordering, project-tests, gate and experimental.yml.
  • Tests: dispatch unit, tier guard and docstring contract give 148 passed. No pin on the removed prose.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at 116970d61. Closes #2229.

  • Review: Sonnet GOOD TO GO, first round.
  • CI: all checks complete, Required checks passed SUCCESS, 0 failed.
  • KTLO: 12 legs, no warnings.
  • Ordering: merged into main and run. protocols leg: 1925 tests, 0 failures.
  • Conflicts: none against the current main.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, 116970d61, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2994 23 1038 25 98.81%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17433 218 4584 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit b0f731c into main Oct 26, 2026
68 checks passed
@JarryShaw
JarryShaw deleted the test/2229-known-degraded branch October 26, 2026 14:00
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Pull requests that add or correct tests (test: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test(dispatch): KNOWN_DEGRADED is kept twice with diverging reasons, and the probe keeps stale IPX/HIP stand-ins

1 participant