Closed perillo closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 65.68%. Comparing base (
49635e7
) to head (2d48999
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm OK with merging all of it at once, it's still separated into commits, or did I misunderstand you?
Thanks for doing this!
I'm OK with merging all of it at once, it's still separated into commits, or did I misunderstand you?
Thanks for doing this!
What I mean is that this is a big change. Personally I would feel insecure about merging a pull request like this. Thanks for the trust!
Well, I looked at the commits, and since it only affects the testsuite (which also runs fine), I'm not too worried!
This is the first of a series of PR to improve the test suite readability and reliability.
[x] tests: ensure python 3.8
This version supports features that will help improving the current implementation:
subprocess.run
Update
tests.CMakeLists.txt
to find the Python3 package.Add the
ruff.toml
file. Line lenght has been set to 100, and isort is enabled for lint.See also https://devguide.python.org/versions/
[x] tests: run "ruff format tests/tools"
Run "ruff format tests/tools" and "ruff format tests/tools/run-tests"
This commit changes a lot of code
statistics: tests/tools/accumulate.py | 166 +++++++++-- tests/tools/bash.py | 327 +++++++++++++++++++--- tests/tools/bash_linux_only.py | 42 ++- tests/tools/basic.py | 19 +- tests/tools/compiled.py | 463 +++++++++++++++++++++++++------ tests/tools/compiled_basic.py | 81 +++++- tests/tools/filter.py | 51 +++- tests/tools/parse_cobertura.py | 19 +- tests/tools/python.py | 127 ++++++++- tests/tools/run-tests | 6 +- tests/tools/system_mode.py | 32 ++- tests/tools/testbase.py | 23 +- 12 files changed, 1153 insertions(+), 203 deletions(-)
[x] tests: run "ruff check --fix tests/tools"
Run "ruff check --fix tests/tools" and "ruff check --fix tests/tools/run-tests"
Apply safe fixes.
[x] tests: run "ruff check --fix --unsafe-fixes tests/tools"
Run "ruff check --fix --unsafe-fixes tests/tools" and "ruff check --fix --unsafe-fixes tests/tools/run-tests"
Apply unsafe fixes. These are actually safe.
These are additional errors reported by ruff:
tests/tools/compiled.py:217:9: F821 Undefined name
self
tests/tools/compiled.py:321:9: E722 Do not use bareexcept
tests/tools/compiled.py:685:9: F821 Undefined nametime
tests/tools/compiled.py:689:9: F821 Undefined nametime
tests/tools/system_mode.py:61:9: E722 Do not use bareexcept
Most of the code change has be done automatically. Also note that some change are not optimal, but I avoided manual changes.
Since review will be very hard and you should not trust me, I suggest to @SimonKagstrom that
Only merge the first commit. Add a commit for each of the following commands:
I used
ruff 0.3.3
but it should be ok to use a different version.Formatting the code will make future changes more easy. As an example, I plan to change how the command line is created for
subprocess
. Currently is is a string, where arguments are concatenated together; it is terrible!