python/iotests: Run iotest linters during Python CI
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest13 patches 17 repliesIn review
V4 from the cover letter
- Some optimizations and touchups were included in 'PATCH v2 0/6]
iotests: update environment and linting configuration' instead, upon which this series is now based.
- Rewrote most patches, being more aggressive about the factoring between "iotest" and "linter invocation". The patches are smaller now.
- Almost all configuration is split out into mypy.ini and pylintrc.
- Remove the PWD/CWD juggling that the previous versions added; it's not strictly needed for this integration. We can re-add it later if we wind up needing it for something.
- mypy and pylintrc tests are split into separate tests. The GitLab CI now lists them as two separate test cases, so it's easier to see what is failing and why. (And how long those tests take.) It is also now therefore possible to ask avocado to run just one or the other.
- mypy bug workaround is only applied strictly in cases where it is needed, optimizing speed of iotest 297.
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | iotests/297: Move pylint config into pylintrctests/ tests/ | +17 | 1 reply | |
| 2/13 | iotests/297: Split mypy configuration out into mypy.initests/ tests/ | +13 | 2 replies | |
| 3/13 | iotests/297: Add get_files() functiontests/ | +7 | 1 reply | |
| 4/13 | iotests/297: Don't rely on distro-specific linter binariestests/ | +2 | 0 replies | |
| 5/13 | iotests/297: Create main() functiontests/ | +8 | 2 replies | |
| 6/13 | iotests/297: Separate environment setup from test executiontests/ | +14 | 1 reply | |
| 7/13 | iotests/297: Split run_linters apart into run_pylint and run_mypytests/ | +12 | 1 reply | |
| 8/13 | iotests/297: refactor run_[mypy|pylint] as generic execution shimtests/ | +25 | 1 reply | |
| 9/13 | iotests: split linters.py out from 297tests/ tests/ | +88 | 3 replies | |
| 10/13 | iotests/linters: Add entry point for linting via Python CItests/ | +18 | 2 replies | |
| 11/13 | iotests/linters: Add workaround for mypy bug #9852tests/ | +3 | 1 reply | |
| 12/13 | python: Add iotest linters to test suitepython/ python/ | +8 | 1 reply | |
| 13/13 | iotests: [RFC] drop iotest 297tests/ tests/ tests/ | +2 | 1 reply |
Reviews trailers per patch
11 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Vladimir Sementsov-Ogievskiy | Philippe Mathieu-Daudé | Hanna Reitz |
|---|---|---|---|
| 1/13 | R-b | ||
| 2/13 | R-b | ||
| 3/13 | R-b | ||
| 4/13 | R-b | R-b | R-b |
| 5/13 | R-b | R-b | R-b |
| 6/13 | R-b | ||
| 7/13 | R-b | ||
| 8/13 | A-b | ||
| 9/13 | R-b | ||
| 10/13 | |||
| 11/13 | R-b | ||
| 12/13 | R-b | ||
| 13/13 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH 00/13] python/iotests: Run iotest linters during Python CI
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-iotest-pt2
CI: https://gitlab.com/jsnow/qemu/-/pipelines/382320226
Based-on: <[email protected]>
[PATCH v2 0/6] iotests: update environment and linting configuration (Staged at kwolf/block sans patch #2, not needed here.)
Factor out pylint and mypy configuration from iotest 297 so that the Python test infrastructure in python/ can also run these linters. This will enable what is essentially iotest #297 to run via GitLab CI.
This series generally aims to split "linter configuration" out of code so that both iotest #297 and the Python test suite can both invoke the same linters (nearly) identically.
The differences occur where the Python entryway involves setting up a virtual environment and installing linter packages pinned at specific versions so that the CI test can be guaranteed to behave deterministically.
iotest #297 is left as a way to run these tests as a convenience until I can integrate environment setup and test execution as a part of 'make check' or similar to serve as a replacement. This invocation just trusts you've installed the right packages into the right places with the right versions, as it always has.
V4:
- Some optimizations and touchups were included in 'PATCH v2 0/6]
iotests: update environment and linting configuration' instead, upon which this series is now based.
- Rewrote most patches, being more aggressive about the factoring between "iotest" and "linter invocation". The patches are smaller now.
- Almost all configuration is split out into mypy.ini and pylintrc.
- Remove the PWD/CWD juggling that the previous versions added; it's not strictly needed for this integration. We can re-add it later if we wind up needing it for something.
- mypy and pylintrc tests are split into separate tests. The GitLab CI now lists them as two separate test cases, so it's easier to see what is failing and why. (And how long those tests take.) It is also now therefore possible to ask avocado to run just one or the other.
- mypy bug workaround is only applied strictly in cases where it is needed, optimizing speed of iotest 297.
V3:
- Added patch 1 which has been submitted separately upstream, but was necessary for testing.
- Rebased on top of hreitz/block, which fixed some linting issues.
- Added a workaround for a rather nasty mypy bug ... >:(
V2:
- Added patches 1-5 which do some more delinting.
- Added patch 8, which scans subdirs for tests to lint.
- Added patch 17, which improves the speed of mypy analysis.
- Patch 14 is different because of the new patch 8.
John Snow (13):
iotests/297: Move pylint config into pylintrc iotests/297: Split mypy configuration out into mypy.ini iotests/297: Add get_files() function
iotests/297: Don't rely on distro-specific linter binaries iotests/297: Create main() function
iotests/297: Separate environment setup from test execution iotests/297: Split run_linters apart into run_pylint and run_mypy iotests/297: refactor run_[mypy|pylint] as generic execution shim
iotests: split linters.py out from 297 iotests/linters: Add entry point for linting via Python CI iotests/linters: Add workaround for mypy bug #9852
python: Add iotest linters to test suite
iotests: [RFC] drop iotest 297
python/tests/iotests-mypy.sh | 4 ++
python/tests/iotests-pylint.sh | 4 ++
tests/qemu-iotests/297.out | 2 -
tests/qemu-iotests/{297 => linters.py} | 88 ++++++++++----------------
tests/qemu-iotests/mypy.ini | 12 ++++
tests/qemu-iotests/pylintrc | 16 +++++
6 files changed, 71 insertions(+), 55 deletions(-)
create mode 100755 python/tests/iotests-mypy.sh
create mode 100755 python/tests/iotests-pylint.sh
delete mode 100644 tests/qemu-iotests/297.out
rename tests/qemu-iotests/{297 => linters.py} (52%)
mode change 100755 => 100644
create mode 100644 tests/qemu-iotests/mypy.iniSignature · 1 line
2.31.1