test: honest per-platform interface-listing round-trip contract (#85)#86
test: honest per-platform interface-listing round-trip contract (#85)#86point-source wants to merge 7 commits into
Conversation
…:windows-roundtrip-contract)
…g ability (§spec:windows-roundtrip-contract)
…ot name (§spec:windows-roundtrip-contract)
…ct with conditional matcher
…ip honesty (§spec:windows-roundtrip-contract)
…ak the CI deadlock # Conflicts: # REQUIREMENTS.md
|
Superseded by #85. The CI-on-develop trigger (#85) and this windows-roundtrip fix were in a circular deadlock: #85's Resolution: folded this PR's commits (the per-platform round-trip test fix + No code is lost — everything here ships via #85. Closing to avoid a duplicate. |
What this does
Makes the interface-listing →
Pinground-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 aPing'sinterfacevalue." A round-trip test encoded a stronger reading — that every listed interface name constructs aPing(interface: name)without throwing on every platform. That is false on Windows by the package's own design: Windowspingbinds only by source address, soPingWindowsrejects a bare interface name with a catchableUnimplementedError(§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 WindowsPing, the constructor correctly threw, andcore (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 staysreturnsNormallyon every platform. Keying offPlatform.isWindowsmakes 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
cd dart_ping && dart pub getdart analyze --fatal-infos→ cleandart test -x live→ all pass (196 locally; the previously-redcore (windows-latest)job now passes because the name expectation matches the synchronousUnimplementedErrorPingWindowsthrows at construction).Ping('host', interface: addr)without throwing on every platform; a bare name constructs fine on Linux/macOS but throwsUnimplementedErroron Windows.coreon 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 thanfeat:deliberately — this PR ships no feature and no behavior/API change (only a corrected test expectation + docs), so afeat: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)".