Commit Graph

4 Commits

Author SHA1 Message Date
Jonas Bark
cf32a02400 fix the unlocking method 2026-08-11 18:38:30 +02:00
Jonas Bark
8dba989bed fix(emulation): remove unused emulated_ble_platform import stragglers
flutter analyze flagged these as unused after the harness-promotion
refactor; emulated_peripherals.dart already re-exports what these
tests need.
2026-07-02 11:47:53 +02:00
Jonas Bark
89b876b305 fix(emulation): update integration_test imports to moved lib/bluetooth/emulation harness 2026-07-02 09:22:12 +02:00
Jonas Bark
fa3011448c On-device macOS smoke tests: real Bonjour registration + mDNS packets on the wire
The fast suite in test/integration fakes the nsd plugin, so it can't
prove the OS-level pieces. Add integration_test (run with
`flutter test integration_test -d macos`) covering exactly those:

- Bonjour registration: the WiFi bridge's service resolves through the
  real mDNSResponder, the TXT record (ble-service-uuids / mac-address /
  serial-number) survives the platform-channel round trip, the
  advertised port accepts a real TCP connection and flips the bridge's
  isConnected. Withdrawal is proven functionally (port refuses, fresh
  browse no longer served) — the in-process nsd browser is unreliable
  for removal events on macOS.
- UI → wire: drives the real Smart Trainer details page (tap "Virtual
  Shifting", confirm the consent dialog) and verifies actual mDNS
  packets for the service type and the concrete instance name on the
  224.0.0.251:5353 multicast group via a raw UDP sniffer, which also
  multicasts a real PTR question to elicit an on-wire answer. "No
  connection" stops the bridge again.

The BLE upstream is faked (no hardware / permission prompts); prefs are
kept in-memory so runs never touch the real app's storage; the DirCon
port range is rebased away from a possibly-running live app. All tests
live in one file: launching the macOS app twice back-to-back trips a
flutter-tool relaunch flake. First run prompts for the macOS "Local
Network" permission, which must be granted manually.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 19:45:28 +02:00