Skip to content

ci: engines not exercised across their claimed Python ranges — PyShark has no real-capture coverage, PyPCAPFile dark on 3 of 5 legs #845

Description

@JarryShaw

The maintainer asked whether every engine is exercised in CI across its supported Python
range. Audited: no. Five of eight are; three findings are not. Measured at 6216de505.
unit-tests.yml is the only workflow that runs pytest (grep -ln pytest .github/workflows/*.yml
→ one hit).

1. PyShark is never driven through a real tshark-parsed capture, on any Python version

The only engine='pyshark' extraction is tests/integration/test_engine_runtime.py:90,102.

  • engine-tests installs pyshark and tshark — but its selection is
    --ignore=tests/integration --ignore-glob='*_runtime.py', so it cannot reach that file
    by either route.
  • pypcap-parity has the fixture-tier selection that does reach it and installs pyshark,
    but installs no tshark (grep -ci tshark over its whole job log → 0). So
    PyShark.unsupported_reason() returns the missing-binary reason, the extractor falls back to
    the built-in parser, and line 104's assertGreater(extractor.length, 0) passes on the
    fallback's output
    .
  • integration and gate install no pyshark at all.

A vacuous pass, not a skip — invisible in every skip count. The HAS_PYSHARK gates that
engine-tests does reach (tests/foundation/engines/test_pyshark_engine.py:137,223,245) are all
unsupported_reason/binary-detection. tests/toolkit/test_pyshark_unit.py is FakeLayer
doubles throughout.

Cheapest fix, two lines: add tshark to pypcap-parity's existing apt step — it already
has pyshark and the right selection — and make test_engine_runtime.py:102 assert
extractor._exnam == 'pyshark', as test_new_engine_parity_runtime.py:112-113 already does for
PyPCAP.

This is exactly why the pcapkit/toolkit/pyshark.py link-type defect in #843 survived: the
double sets layer_name='ethernet', which is a LinkType member, so the real-world eth
path was never exercised. Confirmed live here — pyshark reports eth, and PDML <proto name>
carries Wireshark filter names.

2. PyPCAPFile is on engine-tests's install line but resolves to nothing on 3 of 5 legs

Measured, run 36294992326:

Engines leg pypcapfile installed pytest
3.10 yes 1972 passed, 9 skipped
3.11 yes 1973 passed, 8 skipped
3.12 no 1965 passed, 16 skipped
3.13 no 1965 passed, 16 skipped
3.14 no 1965 passed, 16 skipped

Eight tests stop exactly at the python_version < '3.12' marker boundary.
tests/_dependency_gates.py:46-52 says it deliberately does not model environment markers,
so the repo's own guard cannot see this, and three legs read green on coverage they do not have.

Also: pypcapfile 0.12.0 installs cleanly on 3.12+ and only fails at use — a real user state
— so PYTHON_CEILING = (3, 12) firing is never reproduced. PyShark's (3, 14) ceiling is
covered, because pyshark carries no marker.

Cheapest fix: teach _dependency_gates.py to evaluate markers against each job's matrix
(it already retains Requirement.marker at :548-550) so marker-shadowed extras report as gaps.

3. Four of the six third-party engines sit only on non-required checks

Required checks (ruleset 23497679) are exactly Python 3.10-3.14, Integration Python 3.10-3.14, Compat Python 3.10-3.14 — and Compat runs no pytest at all. Neither
Engines Python X nor PyPCAP/PyPCAPFile parity Python X is required, so PyShark, PyPCAP,
PCAP_CT and PyPCAPFile are exercised on zero blocking legs
; only DPKT and Scapy are.
Gate (full suite, Python 3.14) reports skipped on PRs by design.

That follows from #751's "per-engine coverage gets its own job" plus #738's "land it on a
non-blocking leg" — each defensible alone. Decision needed: promote Engines Python 3.10-3.14 into the required set, or record that engine coverage is advisory.

4. Versions claimed but in no matrix

requires-python = ">=3.6, <4" claims 3.6-3.9; no workflow runs any of them. 3.15 appears only
in python-compatibility.yml's schedule-only import check. Either the floor moves or the claim
is untested. PCAP_CT is the one engine that honestly excludes <3.10, via a marker.

Noticed in passing, not urgent

DPKT carries no marker but dpkt 1.9.8 classifies nothing above Python 3.9. PyShark carries
no marker but pyshark 0.6 classifies nothing above 3.10, while pcapkit runs it on 3.11-3.13 —
and pcapkit/foundation/engines/pyshark.py:89-93 admits 3.13 is inferred, not measured.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciPull requests that change CI or workflow configuration (ci: subject prefix)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions