Skip to content

RFC iotests: delinting work-in-progress

John Snow qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6iotests: type hint wiptests/qemu-iotests/iotests.py+14 -140 replies
2/6Makefile: add delint WIPtests/qemu-iotests/Makefile+6 -00 replies
3/6nbd-fault-injector: delinttests/qemu-iotests/Makefile tests/qemu-iotests/nbd-fault-injector.py+21 -150 replies
4/6qed.py: delinttests/qemu-iotests/Makefile tests/qemu-iotests/qed.py+31 -170 replies
5/6qcow2.py: delinttests/qemu-iotests/Makefile tests/qemu-iotests/pylintrc tests/qemu-iotests/qcow2.py+104 -580 replies
6/6WIP: delint test filestests/qemu-iotests/Makefile+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC WIP 0/6] iotests: delinting work-in-progress

I ran out of time, but I was briefly entertaining the idea of hitting everything else in the iotests folder with the pylint and mypy beam.

This is just a draft of what I had at the time, in case someone gets around to it before I do.

I forced all of the python scripts in this directory to Python3 and pass the formatter check imposed by the pylintrc that we make iotests.py adhere to, but there's no guarantee these scripts actually work. I was a little rough around the edges.

qed.py and qcow2.py in particular abuse some python features that pylint really doesn't like to see at all, and forcing these to pass a pylint check was clearly fighting against the idioms in-use in those files, with more than a few unsatisfactory hacks employed just to make pylint shut up. They are not necessarily improvements to those scripts.

I created a Makefile check to hit the iotests themselves with the pylint checker so we can identify when refactors to the testing infrastructure invalidate tests we don't get to run that often; but didn't get around to improving the quality of the tests themselves.

(Whether or not this is even worth our time is debatable, it depends on how much effort it would take to bring them up to par. Maybe it's a lot, I don't know.)

--js

John Snow (6):
iotests: type hint wip
Makefile: add delint WIP
nbd-fault-injector: delint
qed.py: delint
qcow2.py: delint
WIP: delint test files

 tests/qemu-iotests/Makefile              |   6 +
 tests/qemu-iotests/iotests.py            |  28 ++--
 tests/qemu-iotests/nbd-fault-injector.py |  34 +++--
 tests/qemu-iotests/pylintrc              |   1 +
 tests/qemu-iotests/qcow2.py              | 156 +++++++++++++++--------
 tests/qemu-iotests/qed.py                |  46 ++++---
 6 files changed, 173 insertions(+), 98 deletions(-)
Signature · 1 line
2.21.1