ci(molecule): surface scenario failure text via summary and artifact - #77
Merged
Conversation
Raw job logs are served from a blob endpoint the GitHub API cannot reach, so a failed molecule run was undiagnosable through the API: the only retrievable text was "Process completed with exit code 2". The scenario output now goes through tee into a file that feeds the job summary tail and a retained artifact, both of which the API serves. A guard job in the self-test pins the two silent failure modes of that pipe, a missing pipefail and a missing stderr redirect. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
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.
Summary
Process completed with exit code 2.in the check-run annotation. The scenario output is now piped throughteeinto$RUNNER_TEMP, feeding two surfaces the API does serve — the last 200 lines in the job summary, and the full log as an artifact (molecule-log-<driver>-<scenario>, 7 days).set -euo pipefailand2>&1are load-bearing here: without the first the exit code becomestee's and every red run reports green, without the second the file omits the very text it exists for. Apipefail-guardjob inself-pull-request.ymlasserts both against a command that is guaranteed to fail.workflows/README.mdunder the molecule section, including thegh run downloadinvocation.Test plan
tee(exit=2) and stderr lands in the filepipefailabsent from bothsetstatements the guard's assertion fires (exit=1,SHOULD-NOT-REACHunreached); with2>&1dropped the stderr assertion firesline 300and notline 100; empty file and unset variable both produce no disclosure blockshellcheck -s bashclean on every extractedrun:body in both workflows['lint','review','code-scan','pipefail-guard']actionlintis not installed locally and remains a CI-only gate)