Improve CI diagnostics for failing pytest runs - #36
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Upload logs | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: pytest-logs | ||
| path: | | ||
| reports/pytest_quiet.log | ||
| reports/pytest_verbose.log | ||
| reports/pip-freeze.txt |
There was a problem hiding this comment.
Guard artifact upload when optional logs are missing
The artifact step runs unconditionally via if: always() yet requests reports/pytest_verbose.log and reports/pip-freeze.txt. These files are only created when the rerun step executes, so any successful test run—or a repo without tests—will leave them absent. actions/upload-artifact@v4 fails the job by default when a requested path does not exist, causing the workflow to error even though tests passed. Gate the upload to failing runs or set if-no-files-found: ignore for optional files so a clean test run does not report failure.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f96c485da0832885953881e2852079