fix: show every mobile test status in --wait output - #740
Conversation
011db18 to
8824dc7
Compare
Five of the eleven statuses the mobile API can return had no case in emojiStatus, so cancelled, errored, device-wait, device-timeout and carried-over results all printed as "None". skip_passed is the newest of them, added by MOB-3570, but the other four predate it. The if-chain also hand-padded each label so the progress line keeps a steady width, which meant adding a status meant counting spaces. A lookup plus padEnd holds the same seven-column minimum without the counting, so every status that already rendered still renders byte for byte the same. The five new labels run longer than seven characters and pad to nothing, which only affects output that used to read "None". camelcase rejects the API status values as property names and prettier strips quotes that would dodge it, so the table carries a scoped eslint-disable rather than being contorted into another shape. The golden snapshots recorded the bug: sixty-one lines captured a wait_device cell as "None". They now read "Waiting device", which is what those runs were always doing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8824dc7 to
13c0f6e
Compare
xiankai
left a comment
There was a problem hiding this comment.
Nice improvement, some emoji alternatives from me:
Emoji suggestions
❌ for failed
⏩ for skipped
✅⏩ for skip_passed (if 2 emojis is fine)
⏱️ for wait_device_timeout
🚦for queued
…p_passed A single glyph cannot say "skipped, and it passed". A check plus a fast-forward can, but only if the fast-forward means skipped on its own, so skipped moves from a sleep glyph to the fast-forward and skip_passed builds on it. The table holds a list of emoji names per status so a status can carry more than one. wait_device_timeout moves from an alarm clock to a stopwatch, which reads as elapsed time rather than a scheduled alarm. None of these three statuses appears in a golden snapshot, so nothing recorded moves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5de8f00 to
9252bdf
Compare
Takes the rest of the review suggestions: a cross for failed, a traffic light for queuing, and a fast-forward for skipped. All three are applied to both waitTestResult files rather than mobile alone. The two keep separate copies of this function, so changing one would leave "autify web" and "autify mobile" disagreeing about what a failed test looks like. Seven recorded lines in the web snapshots carried the old queuing glyph and now carry the new one; failed and skipped appear in no snapshot on either side. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Took all five. Pushed in
Applied to web as well as mobile. That duplication is the thing worth fixing next. Two copies of one function is why the divergence was even possible, and why mobile has eleven statuses while web still has six. Out of scope here, but someone should collapse them. On the snapshots, worth flagging as evidence rather than housekeeping: 61 recorded lines had captured a I edited those by hand rather than running |
Problem
autify mobile test run --waitprints a status line per poll:emojiStatusinsrc/autify/mobile/waitTestResult.tscovers six statuses. The mobile API returns eleven. The other five fall through to the❔ Nonedefault, so a run that hits any of them tells you nothing:canceledinternal_errorwait_devicewait_device_timeoutskip_passedskip_passedis new, added by MOB-3570 for cells a rerun carries over instead of running again. The other four predate it, so this is not only about that feature.What this does not change
Nothing about exit codes or polling. The loop terminates on
data.finished_at, not on a status allowlist, andisPassedreads the plan status, which never takes any of these values. An unrecognised status was already safe, just illegible. This is a display fix.Why the shape changed
The old chain hand-padded every label to seven characters so the progress line keeps a stable width. That made adding a status a matter of counting spaces, which is a plausible reason five of them were missing. A lookup table plus
padEndholds the same seven-column minimum without the counting.Seven is kept deliberately rather than derived from the longest label. Every status that already rendered has a label of seven characters or fewer, so its output is byte-for-byte unchanged. The five new labels run longer and pad to nothing, so the only lines that move are ones that used to read "None".
camelcaserejects the API status values as property names, and quoting them does not help because prettier's defaultquotePropsstrips the quotes straight back off. The table carries a scopedeslint-disablerather than being contorted into a different data structure to satisfy the linter.Labels match the wording the Autify for Mobile UI already uses, so
skip_passedreads "Already passed" in both places.Snapshot changes
Sixty-one lines across two golden snapshots recorded the bug. Those runs had a test case sitting in
wait_device, and the snapshots captured it as❔ None:They were edited rather than regenerated with
-u. Running the suite locally adds autil._extendDeprecationWarning to stderr that CI does not produce, and-uwould have baked that into every snapshot it touched. The two*Waitsnapshots with no status change are untouched, which is also what confirms the warning is local: they differ only by that line.Checks
npm run build,eslint, andprettier --checkall pass locally. Rendered every status to confirm the emoji names resolve innode-emojiand that the column still lines up:canceledfailedinternal_errorpassedqueuingrunningskip_passedskippedwait_devicewait_device_timeoutwaiting⏩ and ✅⏩ are a pair: the fast-forward means skipped, and the check in front of it means skipped because it had already passed. That only reads if
skippedowns the fast-forward on its own, which is why it moved off the sleep glyph.🚫 for
internal_errormatches thebanicon the Mobile UI already uses for it. ⏹ forcanceledand ⏩ forskippedread as media controls: stopping a run, skipping past a cell.failed,queuingandskippedalso exist insrc/autify/web/waitTestResult.ts, which keeps its own copy of this function, so all three changed there too. Leaving them out of step would meanautify webandautify mobiledisagreeing about what a failed test looks like. Seven recorded lines in the web snapshots carried the old queuing glyph;failedandskippedappear in no snapshot on either side.skipped,failedandqueuingalso exist insrc/autify/web/waitTestResult.ts, which keeps its own copy of this function. Onlyskippedchanged here, so web still shows 💤 for it. Worth reconciling, but in its own change rather than this one.