-
Couldn't load subscription status.
- Fork 4
Run previously failed tests first #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Marenz
commented
Oct 30, 2024
- CI: Run previously failed tests first
- CI: Use uv backend for nox
74370f4 to
b350319
Compare
Signed-off-by: Mathias L. Baumann <[email protected]>
Signed-off-by: Mathias L. Baumann <[email protected]>
|
|
||
| # Save pytest cache only for pytest_min session | ||
| - name: Save pytest cache | ||
| if: always() && matrix.nox-session == 'pytest_min' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think matrix.nox-session will be interpreted as a string rather than being evaluated as a variable without ${{ }}, thus the condition will be always false
| if: always() && matrix.nox-session == 'pytest_min' | |
| if: always() && ${{ matrix.nox-session == "pytest_min" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I see it works.
I read the docs too and that confirms it too, though there are exceptions for cases that this won't work.
When you use expressions in an if conditional, you can, optionally, omit the ${{ }} expression syntax because GitHub Actions automatically evaluates the if conditional as an expression. However, this exception does not apply everywhere.
You must always use the ${{ }} expression syntax or escape with '', "", or () when the expression starts with !, since ! is reserved notation in YAML format. For example:
I've also seen in line 66 it is written if: ${{ matrix.nox-session == 'pytest_min' }} and ideally we should be consistent on how these statements are written.
IMO it feels safer to always use ${{ }}, and I agree it doesn't look good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if repos CI don't start to diverge, so I would definitely push for moving this to a common place like repo-config, or even better, https://github.com/frequenz-floss/gh-action-nox, and start pushing to use these GH actions more.
As for uv, I still wonder if pre-releases won't be an issue to start using it as the default. But maybe we have to suck it up and adapt to whatever uv wants, as it is orders of magnitude better than pip.
What you mean "more" I looked and there isn't a single repo using them :P |
|
Internal repo, but there is an usage example in the action repo itself. |
