[PATCH 12/13] python: Add iotest linters to test suite

John Snow posted 13 patches 4 years, 2 months ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Cleber Rosa <crosa@redhat.com>, John Snow <jsnow@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
[PATCH 12/13] python: Add iotest linters to test suite
Posted by John Snow 4 years, 2 months ago
Run mypy and pylint on the iotests files directly from the Python CI
test infrastructure. This ensures that any accidental breakages to the
qemu.[qmp|aqmp|machine|utils] packages will be caught by that test
suite.

It also ensures that these linters are run with well-known versions and
test against a wide variety of python versions, which helps to find
accidental cross-version python compatibility issues.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/tests/iotests-mypy.sh   | 4 ++++
 python/tests/iotests-pylint.sh | 4 ++++
 2 files changed, 8 insertions(+)
 create mode 100755 python/tests/iotests-mypy.sh
 create mode 100755 python/tests/iotests-pylint.sh

diff --git a/python/tests/iotests-mypy.sh b/python/tests/iotests-mypy.sh
new file mode 100755
index 00000000000..ee764708199
--- /dev/null
+++ b/python/tests/iotests-mypy.sh
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+cd ../tests/qemu-iotests/
+python3 -m linters --mypy
diff --git a/python/tests/iotests-pylint.sh b/python/tests/iotests-pylint.sh
new file mode 100755
index 00000000000..4cae03424b4
--- /dev/null
+++ b/python/tests/iotests-pylint.sh
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+cd ../tests/qemu-iotests/
+python3 -m linters --pylint
-- 
2.31.1


Re: [PATCH 12/13] python: Add iotest linters to test suite
Posted by Hanna Reitz 4 years, 2 months ago
On 04.10.21 23:05, John Snow wrote:
> Run mypy and pylint on the iotests files directly from the Python CI
> test infrastructure. This ensures that any accidental breakages to the
> qemu.[qmp|aqmp|machine|utils] packages will be caught by that test
> suite.
>
> It also ensures that these linters are run with well-known versions and
> test against a wide variety of python versions, which helps to find
> accidental cross-version python compatibility issues.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   python/tests/iotests-mypy.sh   | 4 ++++
>   python/tests/iotests-pylint.sh | 4 ++++
>   2 files changed, 8 insertions(+)
>   create mode 100755 python/tests/iotests-mypy.sh
>   create mode 100755 python/tests/iotests-pylint.sh

Reviewed-by: Hanna Reitz <hreitz@redhat.com>