Repository navigation
tests: Add fail_on_changes to toxgen - #4072
Merged
Merged
Conversation
fail_on_changes to toxgen
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
sentrivana
marked this pull request as ready for review
February 18, 2025 15:29
sentrivana
requested review from
antonpirker,
sl0thentr0py and
szokeasaurusrex
February 18, 2025 15:35
szokeasaurusrex
approved these changes
Feb 18, 2025
szokeasaurusrex
left a comment
Member
There was a problem hiding this comment.
Looks good, but please address comments before merging
Comment on lines
+143
to
+145
| if older_than is not None: | ||
| if datetime.fromisoformat(meta["upload_time_iso_8601"]) > older_than: | ||
| continue |
Member
There was a problem hiding this comment.
[nit – feel free to ignore]
Suggested change
| if older_than is not None: | |
| if datetime.fromisoformat(meta["upload_time_iso_8601"]) > older_than: | |
| continue | |
| if older_than is not None and datetime.fromisoformat(meta["upload_time_iso_8601"]) > older_than: | |
| continue |
Comment on lines
+604
to
+608
| Please make sure to not make manual changes to `tox.ini`. The file | ||
| is generated from a template in `scripts/populate_tox/tox.jinja` | ||
| by the `scripts/populate_tox/populate_tox.py` script. Any changes | ||
| should be made to the template or the script directly and the | ||
| resulting `tox.ini` file should be generated with: |
Member
There was a problem hiding this comment.
Some suggestions to improve readability and clarity:
Suggested change
| Please make sure to not make manual changes to `tox.ini`. The file | |
| is generated from a template in `scripts/populate_tox/tox.jinja` | |
| by the `scripts/populate_tox/populate_tox.py` script. Any changes | |
| should be made to the template or the script directly and the | |
| resulting `tox.ini` file should be generated with: | |
| Please do not make manual changes to `tox.ini`. The | |
| `scripts/populate_tox/populate_tox.py` script generates `tox.ini` | |
| using the `scripts/populate_tox/tox.jinja` template. | |
| Instead, modify the template or the script as needed, then run the | |
| following commands to regenerate `tox.ini`: |
Collaborator
Author
There was a problem hiding this comment.
Reworded this to also include #4072 (comment)
Comment on lines
+601
to
+602
| Detected an unexpected change in `tox.ini` that is not reflected | ||
| in `tox.jinja` and/or `populate_tox.py`. |
Member
There was a problem hiding this comment.
Can this error also occur if the jinja template and/or populate_tox.py script are changed, but we forget to regenerate the tox.ini file afterwards? If yes, please mention this possibility, as well
sl0thentr0py
approved these changes
Feb 18, 2025
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.
Add
fail_on_changesto toxgen. The idea is that the script will now have two modes:fail_on_changesisFalse) that is used to actually generate thetox.inifile. This will be run in a cron job in CI and create a PR with the updated test setup.fail_on_changesisTrue) that is used to detect manual changes to one of the affected files without updating the rest (e.g. making a manual change totox.iniwithout updating thetox.jinjatemplate). This will be run in CI similar to thefail_on_changescheck ofsplit-tox-gh-actions.The problem with detecting manual changes is that if we just reran the script on each PR, chances are it would pull in new releases that are not part of the
tox.inion master, making the file look different from what was committed as if it had unrelated manual changes.To counteract this, we now store the timestamp when the file was last generated in
tox.ini. We use this in fail-on-changes mode to filter out releases that popped up after the file was last generated. This way, the package versions should be the same and if there is anything different intox.ini, it's likely to be the manual changes that we want to detect.Closes #4051