Skip to content

test: remove the cross-engine agreement tests from the shared modules (#1708) - #1714

Merged
JarryShaw merged 1 commit into
mainfrom
test/1708-remove-cross-engine-agreement-tests
Oct 14, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
test/1708-remove-cross-engine-agreement-tests

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Description of your pull request and other information

Third-party engines are best effort (#1687), so this PR removes the tests that pin a third-party engine to the default engine's output. It changes tests only. The adapter code is unchanged, so every test it keeps passes on today's code.

19 tests removed (12 of them in the deleted modules), 26 rewritten; 1,516 lines deleted and 257 added.

Runs: the edited modules pass on 3.14 (48 passed, 10 skipped) and on 3.11 with pyshark and pypcapfile (51 passed, 3 skipped because pypcap is not installed). tests/test_tier_guard.py and the project guards pass on both. --collect-only over tests/foundation tests/integration tests/toolkit collects 898 tests on both.

Part of #1708

…#1708)

Third-party engines are best effort (#1687), so a disagreement with the
default engine is no longer a defect. Tests only; no adapter code changes.

- Delete the agreement-only modules: test_engine_agreement_runtime,
  its retry test, test_ext_chain_limit_agreement_1604 and
  test_pypcapfile_linktype_and_layer_bound_agreement_1609_1667.
- test_new_engine_parity_runtime: drop the four agreement methods; the
  ran-checks, capability gaps and PCAP-NG refusals stay.
- integration parity modules: drop the cross-engine equality lines; each
  adapter is checked against constants or the capture's own octets.
- test_engine_pcap_trace_runtime (#1507): each engine's traced PCAP holds
  the flow's records as read from the capture by hand.
- carrier walk, tunnelled flow key, 1607 header checks: keep the
  default-engine checks, scapy's later-fragment stop and the two dpkt
  crash guards as constants; 1607 stays as a helper module because two
  single-engine modules import it.
- snapped-capture and TSO trace tests: dpkt and scapy against constants.

Edited modules pass on 3.14 and 3.11; tier and project guards pass.
@JarryShaw JarryShaw added test Pull requests that add or correct tests (test: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 14, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 3dd223569 (rebased from d7bd4a131 onto 375d37ae5, tests only).

  • Scope: a Sonnet cross-review found no B check removed that the plan did not order removed. It confirmed the 4 deleted modules and the agreement methods are agreement-only, spot-checking 8.
  • Kept: test_dpkt_scapy_ipv4_header_checks_1607_unit.py stays, minus its agreement tests, because two single-engine modules import its helpers.
  • Tests: the rewritten crash and data checks catch the reviewer's own mutations: scapy's later-fragment stop, IPv6 tl, and dpkt trace length. Edited modules: 48 passed on 3.14, 51 on 3.11.
  • Guards and collection: the tier guard and project guards pass, 199 each. Collection over tests/foundation, tests/integration and tests/toolkit is clean on this head (898 tests).
  • Next: the per-engine reverts (phase 2) start once this merges.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 89.47% (unit tier, Python 3.15, 3dd223569, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18858 954 2366 868 91.06%
pcapkit/corekit 2372 67 762 35 96.49%
pcapkit/dumpkit 275 3 100 3 98.40%
pcapkit/foundation 3035 151 1076 34 94.28%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17166 226 4580 190 98.07%
pcapkit/toolkit 1437 281 592 6 77.97%
pcapkit/utilities 494 4 146 4 98.75%
pcapkit/vendor 4417 2342 1010 157 43.38%

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

@JarryShaw
JarryShaw merged commit 9808d51 into main Oct 14, 2026
52 checks passed
@JarryShaw
JarryShaw deleted the test/1708-remove-cross-engine-agreement-tests branch October 14, 2026 04:03
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 14, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 14, 2026
JarryShaw added a commit that referenced this pull request Oct 14, 2026
…ms (#1708)

Third-party engines are best effort (#1687), so the docs stop saying
they match the default engine:

- toolkit/3rdparty: open with the best-effort contract, which no page
  stated; protocol rules belong in the default engine only
- reassembly/ip/ipv6: the pcap and pcapng adapters subtract the Fragment
  header; dpkt and scapy leave it out too, as best effort, not contract
- protocols/internet: scapy behind IPv4 walks up to
  EXTENSION_HEADER_LIMIT headers, not "stops at the same depth"
- engines/3rdparty: dpkt dates a Simple Packet Block 0, without the
  "as the default engine does"
- contributing/pep: pypcap and pypcapfile are best effort; the claim
  that each agrees with the default engine went with #1714's tests

Sphinx 9.1.0: the warning set is identical before and after.

Refs #1708
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone 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.

1 participant