[docs] TauriPlatforms: Review, measurements on the tablet and Windows, lessons, gaps

This commit is contained in:
2026-11-17 19:02:04 +01:00
parent 9e3d389f82
commit b2b50efd90
9 changed files with 256 additions and 16 deletions
+38
View File
@@ -146,3 +146,41 @@ asserts something the edge makes false.
**How to apply it.** Bound every search to the region the test means (here: daytime on the
pour's own local day), and when a test built on a search fails, print what the search
returned before debugging the code under test.
## A constant the minifier folds cannot be found in the bundle
**What happened.** The first shell-build test (`apps/rosea-tauri/test/shell-build.test.ts`, 2026-11-17)
asserted that the string `"tauri"` was in the built JavaScript, to prove `__ROSEA_SHELL__` was
`'tauri'`. Vite replaces the constant, and the minifier then folds `'tauri' === 'tauri'` to `!0`:
the string is gone whether the build was right or wrong.
**Why it bit.** A test that reads build output tests every step of the build, the minifier included.
An assertion about a literal that only exists before minification is about the source, not the bundle.
**How to apply it.** Assert what the bundle must not contain (the constant's name, which would throw
in the webview), and prove the behaviour where it runs: here, the device check.
## A window after a match can read the neighbour's value
**What happened.** The first APK check looked for a WebView switch's value in the 300 characters
after its name in `aapt2 dump xmltree`. The next `<meta-data>` element starts within those 300
characters, so a switch turned the wrong way could pass on its neighbour's value.
**Why it bit.** A fixed window feels safe because the right answer is inside it; so is a wrong one.
**How to apply it.** Read structured output by its structure (here: the value attribute on the line
after the name attribute), and keep a test that flips exactly one value on real output and expects
that one name back.
## A dropped device link is not a failed test, and must not look like a pass either
**What happened.** On 2026-11-17 the USB link to the Android tablet dropped at least twice within the
hour (`device offline`; adb's transport id went 1 → 4 → 5), once between the two visits of the
garden check, which then failed on `am force-stop`.
**Why it bit.** A real device is a second machine with its own life. Retrying everything hides real
failures; retrying nothing makes the check a coin toss.
**How to apply it.** Retry only the failure that names the link (`offline`, `closed`, `no devices`),
after `adb wait-for-device`, a bounded number of times; find the device handle again after a drop;
let every other failure end the check at once. Report how many runs failed and why.