fix: recognize every terminal xcodebuild phase marker - #86
Conversation
xcodebuild ends each operation with `** <PHASE> SUCCEEDED/FAILED **`, but the parser matched only the BUILD and TEST literals. Archive and export runs ended without positive evidence and reported `status: "incomplete"` plus a truncation hint. Match the marker shape instead of each phase. The same gap existed on two more paths: - `** ARCHIVE FAILED **` never reached the status parser, because the fast-path buckets held `BUILD FAILED` and `TEST FAILED` only. - xcbeautify rewrites the whole family to `<Phase> Succeeded`, but the xcbeautify path knew `Build Succeeded` and `Test Succeeded` only, so even `Test Execute Succeeded` was lost. Fixes #85
The xcbeautify path set `sawSuccessMarker` for any line that contains " Succeeded". xcbeautify rewrites `** <PHASE> SUCCEEDED **` to "<Phase> Succeeded" and drops the `**` brackets, so a run-script line such as "[Upload] Upload Succeeded" matched too. A killed build then reported `success` instead of `incomplete`, which breaks the documented rule that xcsift never reports a truncated run as `success`. Match the known phase names instead. The list is verified against xcbeautify 3.2.1 for the whole xcodebuild action set. The bare suffix stays as a cheap gate in front of the phase test, so the cost per line does not change. Two more fixes in the same area: - `** TEST EXECUTE FAILED **` now ends a test that is still in flight, as `** TEST FAILED **` already does. - A terminal phase marker is authoritative again. Only `** TEST FAILED **` keeps the issue #52 escape hatch, because xcodebuild prints that one marker for a run that passes under `-skipMacroValidation`. An `** ARCHIVE FAILED **` no longer reports `success` after a passed test.
Self-review — one regression found and fixed in 82c086a
Fixed: the xcbeautify path accepted run-script output as a marker
This broke the rule in The fix matches the known phase names. I checked every xcodebuild action against xcbeautify 3.2.1 and listed all 15 rewrites, so Also fixed
WithdrawnI first read the missing xcbeautify failure marker as a gap. It is not. xcbeautify prints Verification against issue #85No truncation hint on stderr. Both markers also pass end to end through real xcbeautify 3.2.1. New tests
|
Fixes #85.
Problem
xcodebuildends every operation with** <PHASE> SUCCEEDED **or** <PHASE> FAILED **, but the parser matched a fixed list of literals:BUILD,TEST,TEST EXECUTE. Archive and export runs therefore ended without positive terminal evidence and reportedstatus: "incomplete"with a truncation hint after a successful run.The issue names two markers; the same shape gap broke three code paths:
** ARCHIVE SUCCEEDED **** EXPORT SUCCEEDED **** CLEAN SUCCEEDED **/** ANALYZE SUCCEEDED **** ARCHIVE FAILED **/** EXPORT FAILED **Archive Succeeded(xcbeautify)Test Execute Succeeded(xcbeautify)parseBuildAndTestTimematched per-phase literals.BUILD FAILEDandTEST FAILEDonly, so** ARCHIVE FAILED **never reached the status parser at all.PhaseSuccessCaptureGrouprewrites** <PHASE> SUCCEEDED **to<Phase> Succeeded— but the xcbeautify path knewBuild SucceededandTest Succeededonly.Change
Match the marker shape (
SUCCEEDED **/FAILED **, andSucceededfor xcbeautify) instead of each phase name. TheTEST FAILEDbranch moves first to keep its.testRunFailedevent. New phases from future Xcode releases now work without a code change.** BUILD INTERRUPTED **staysincomplete— it is not a terminal outcome.Verification
swift test— 440 tests, 0 failures.ParsingTests, archive/export/test-execute plus an ANSI-colored marker inXcbeautifyTests.printf '** ARCHIVE SUCCEEDED **\n' | xcbeautify | xcsift --xcbeautifyreportssuccess.build.txtfixture parses unchanged (0.37 s).The colored-marker test guards a real trap: the terminal renderer emits
\033[32;1mArchive Succeeded\033[0m, so the check must staycontains, nothasSuffix.