fix: composer non-zero exit still parses results and uploads#3
Merged
Conversation
The library's composer script exits 1 whenever any test fails — that's its normal reporting channel. Rethrowing on exec.exec's non-zero exit made the action skip parse + API upload + artifact upload + PR comment + outputs, leaving observers with completely empty outputs whenever a single test failed. Now: log a core.warning, keep stepFailed=true (so Flashlight teardown captures logs), and continue to the parse/upload/report path. The final core.setFailed still fires when report.failed > 0. If composer literally could not launch (missing binary), the caller sees the message in the warning; parsing will find no results.json and fall through to zero-report + warning. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
The PHP library's composer script (
composer run prestaflow:json:file) exits 1 whenever any test fails — that's its normal reporting channel. On top of that, the CLI may exit non-zero for benign PHP warnings.The action was doing:
Rethrowing meant
parseResults(),uploadToApi(),uploadArtifacts(),setOutputs()and the PR comment were all skipped. Result: any workflow where at least one test failed showed completely empty outputs and no upload, defeating the whole point of the action.Fix
Log a
core.warning, keepstepFailed=true(so Flashlight teardown captures logs), and continue to the parse/upload/report path. The finalcore.setFailed()still fires whenreport.failed > 0, so job status stays honest.Reproduced by
The smoke run at github-action-smoke/actions/runs/29165011362 shows composer exiting 1 (one test asserting
PRESTAFLOW_FO_URL != nullfailing in the no-Flashlight job) and every output coming out empty.Test plan
🤖 Generated with Claude Code