mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
test: add portal hardware lifecycle coverage
This commit is contained in:
@@ -25,6 +25,13 @@ Start a release with `bump-version.sh`. It updates package metadata and canonica
|
||||
./scripts/prepare-release.sh vMAJOR.MINOR.PATCH --tag
|
||||
```
|
||||
|
||||
When a physical ESP8266 and ESP32 are available, include their local lifecycle tests in the release gate. These tests remain opt-in because they flash the selected board and use its actual radio:
|
||||
|
||||
~~~bash
|
||||
./scripts/test.sh hardware --platform esp8266 --port /dev/serial/by-id/usb-...
|
||||
./scripts/test.sh hardware --platform esp32 --port /dev/serial/by-id/usb-...
|
||||
~~~
|
||||
|
||||
Push the branch and annotated tag. GitHub Actions repeats the board-free compile checks, validates the package, and creates a GitHub Release using that version’s changelog section. The workflow does not publish to the PlatformIO Registry.
|
||||
|
||||
Back to [documentation](README.md) · [project overview](../README.md).
|
||||
|
||||
+32
-1
@@ -9,6 +9,37 @@ check, so dependency resolution uses the current manifest rather than a stale
|
||||
./scripts/test.sh compile --platform esp32
|
||||
```
|
||||
|
||||
CI runs both checks for pushes to the maintained branch and pull requests. They compile only; hardware portals remain a local integration concern for the consuming application.
|
||||
## Example builds
|
||||
|
||||
```bash
|
||||
./scripts/test.sh examples --platform esp8266
|
||||
./scripts/test.sh examples --platform esp32
|
||||
```
|
||||
|
||||
CI runs the clean-consumer and example checks for pushes to the maintained branch and pull requests. It intentionally compiles only: attached boards, local network state, and browser installation are not CI requirements.
|
||||
|
||||
## Local hardware lifecycle tests
|
||||
|
||||
The existing Unity suite runs on a board without Wi-Fi credentials, MQTT, a DeviceFramework checkout, or a local profile. It verifies portal start and stop lifecycle recovery, scan-cache release, and a real asynchronous Wi-Fi scan.
|
||||
|
||||
Use a stable serial-by-id path rather than a changing /dev/ttyUSB number:
|
||||
|
||||
~~~bash
|
||||
pio device list
|
||||
./scripts/test.sh hardware --platform esp8266 --port /dev/serial/by-id/usb-...
|
||||
./scripts/test.sh hardware --platform esp32 --port /dev/serial/by-id/usb-...
|
||||
~~~
|
||||
|
||||
The runner uploads the test image, captures its normal-boot serial output with the repository Bash helper, requires Unity's Tests 0 Failures and OK summary, and prints WM_METRIC lifecycle measurements. It does not need or read an environment file. A failed capture is preserved under /tmp for inspection; a successful one is removed.
|
||||
|
||||
## Optional portal browser test
|
||||
|
||||
test/portal-harness is a deliberately tiny portal-only firmware. It is not an example or a consuming application. The browser runner flashes it to the selected board, joins the portal with an explicitly named secondary Wi-Fi adapter, checks root HTML and bootstrap JSON, exercises concurrent root/bootstrap responses, and verifies an asynchronous scan. When a compatible local Chromium binary is available, it also captures the portal and records browser-console output.
|
||||
|
||||
~~~bash
|
||||
./tools/test-portal-browser.sh --platform esp8266 --port /dev/serial/by-id/usb-... --wifi-interface wlx74da385d4165 --output /tmp/wifimanager-browser-results
|
||||
~~~
|
||||
|
||||
The runner refuses an interface that owns the host's default route. It creates a temporary NetworkManager connection with never-default before bringing it up, so portal traffic stays on the specified adapter and does not replace the host Internet route. The temporary connection is removed on exit. Use a non-default secondary adapter only.
|
||||
|
||||
Back to [documentation](README.md) · [project overview](../README.md).
|
||||
|
||||
Reference in New Issue
Block a user