ci: show vite server logs only on failure#899
Open
kitsuyui wants to merge 1 commit into
Open
Conversation
The EXIT trap was unconditionally printing the vite server log on both success and failure, polluting CI output with diagnostic noise on successful runs. Diagnostic logs should aid debugging on failure only. Split the log display into a separate step with `if: failure()`, which is the GitHub Actions idiomatic pattern for failure-only diagnostics. The trap now only handles cleanup (killing the vite process). Applies the same fix to both test.yml and octocov.yml which had the identical pattern.
Code Metrics Report
Details | | main (2c70363) | #899 (208a25c) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 0.0% | 0.0% | 0.0% |
| Files | 0 | 0 | 0 |
| Lines | 0 | 0 | 0 |
| Covered | 0 | 0 | 0 |
| Code to Test Ratio | 1:0.6 | 1:0.6 | 0.0 |
| Code | 19 | 19 | 0 |
| Test | 13 | 13 | 0 |
+ | Test Execution Time | 18s | 1s | -17s |Reported by octocov |
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
Fix the CI EXIT trap in
test.ymlandoctocov.ymlso that the vite server log is only shown when the workflow fails, not on every run.Problem
Both workflows had this trap:
The
catruns unconditionally — on success and failure alike. Diagnostic logs should help debug failures, not appear as noise when tests pass. On a successful run, the vite log output adds clutter without value.Change
Split the log display into a separate step using GitHub Actions'
if: failure():This is the idiomatic GitHub Actions pattern for failure-only diagnostics. The trap now only handles cleanup; the log display is conditional.
Applied the same fix to both
test.yml(E2E Test step) andoctocov.yml(Test with coverage step), which had the identical pattern.Verification