Skip to content

test: honest per-platform interface-listing round-trip contract (#85)#86

Closed
point-source wants to merge 7 commits into
developfrom
feature/windows-check-is-fai-qcv
Closed

test: honest per-platform interface-listing round-trip contract (#85)#86
point-source wants to merge 7 commits into
developfrom
feature/windows-check-is-fai-qcv

Conversation

@point-source

Copy link
Copy Markdown
Owner

What this does

Makes the interface-listing → Ping round-trip contract honest per platform (issue #85). This is a test-expectation + documentation correction only — no runtime or public-API change on any platform.

The interface-listing helper (listNetworkInterfaces, #72) promises a listed interface "feeds back into a Ping's interface value." A round-trip test encoded a stronger reading — that every listed interface name constructs a Ping(interface: name) without throwing on every platform. That is false on Windows by the package's own design: Windows ping binds only by source address, so PingWindows rejects a bare interface name with a catchable UnimplementedError (§spec:interface-platform-rejection). Once the cross-OS matrix (#77) ran the core suite on a real Windows runner that reports a named NIC (e.g. "Ethernet 3"), the test fed that name into a Windows Ping, the constructor correctly threw, and core (windows-latest) went red (195 passed, 1 failed). The defect was in the test's expectation, not Windows behavior.

Changes

  • dart_ping/test/interface_listing_test.dart — the name round-trip expectation now branches on the platform's binding ability, not on the host's NIC list: Platform.isWindows ? throwsA(isA<UnimplementedError>()) : returnsNormally. The source-address round-trip stays returnsNormally on every platform. Keying off Platform.isWindows makes the check deterministic on any runner, independent of which interfaces it reports.
  • dart_ping/lib/src/interface_listing.dart — dartdoc note: on Windows, pass a listed interface back as its source address, not its name; the address form round-trips everywhere, the name form only where the OS binds by name (Linux/Android, macOS).
  • dart_ping/README.md, dart_ping/CHANGELOG.md — same per-platform note for consumers.
  • SPEC.md, REQUIREMENTS.md§spec:windows-roundtrip-contract + §req:windows-roundtrip-* captured and marked implemented.

Windows runtime behavior is unchanged: source-address selection still binds; a bare name is still rejected loudly (never a silent default-route ping).

§spec sections now complete

  • §spec:windows-roundtrip-contract — per-platform round-trip honesty (address round-trips on every desktop platform; name only where the OS binds by name; Windows name rejected, address accepted). Backed by §req:windows-roundtrip-problem-statement / -success-criteria / -constraints / -quality-attributes / -user-stories / -priorities.

Integration test path for the reviewer

  1. cd dart_ping && dart pub get
  2. dart analyze --fatal-infos → clean
  3. dart test -x live → all pass (196 locally; the previously-red core (windows-latest) job now passes because the name expectation matches the synchronous UnimplementedError PingWindows throws at construction).
  4. Spot-check the contract: a listed interface's address constructs Ping('host', interface: addr) without throwing on every platform; a bare name constructs fine on Linux/macOS but throws UnimplementedError on Windows.
  5. Confirm the cross-OS CI matrix (core on ubuntu/windows/macos, ios-dart, ios-swift) is green across all three OSes.

Out of scope (per §req:windows-roundtrip-constraints): resolving a Windows interface name → source address so names round-trip everywhere; the Windows IPv6 gap (#71).

Note on the title

Titled test: rather than feat: deliberately — this PR ships no feature and no behavior/API change (only a corrected test expectation + docs), so a feat: would mis-trigger a minor release on the semantic-release pipeline.

Review

An automated multi-agent code review was already completed in kandev during the Review gate (compared against develop). It found no actionable correctness/cleanup findings in the #85 delta and confirmed CI green. See the kandev planning task's plan artifact: "Code review — Windows interface-listing round-trip contract (#85)".

point-source added a commit that referenced this pull request Jun 19, 2026
…ak the CI deadlock

# Conflicts:
#	REQUIREMENTS.md
@point-source

Copy link
Copy Markdown
Owner Author

Superseded by #85. The CI-on-develop trigger (#85) and this windows-roundtrip fix were in a circular deadlock: #85's core (windows-latest) failed on the exact stale test this PR fixes, while this PR couldn't get any checks because the develop-PR trigger only exists on #85's branch.

Resolution: folded this PR's commits (the per-platform round-trip test fix + interface_listing.dart/README/CHANGELOG doc notes + the SPEC/REQUIREMENTS governance for §spec:windows-roundtrip-contract) into #85's branch (feature/run-ci-on-pr-to-deve-qrb), union-merging the SPEC.md/REQUIREMENTS.md overlap. #85's cross-OS matrix re-ran and core (windows-latest) now passes (45s), so #85 carries both changes to develop in one green merge.

No code is lost — everything here ships via #85. Closing to avoid a duplicate.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant