All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] python/iotests: Run iotest linters during Python CI
@ 2021-10-04 21:04 John Snow
  2021-10-04 21:04 ` [PATCH 01/13] iotests/297: Move pylint config into pylintrc John Snow
                   ` (12 more replies)
  0 siblings, 13 replies; 31+ messages in thread
From: John Snow @ 2021-10-04 21:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Eduardo Habkost, qemu-block, Hanna Reitz,
	Cleber Rosa, John Snow

GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-package-iotest-pt2
CI: https://gitlab.com/jsnow/qemu/-/pipelines/382320226
Based-on: <20210923180715.4168522-1-jsnow@redhat.com>
          [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.ini

-- 
2.31.1




^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-10-13 16:29 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 21:04 [PATCH 00/13] python/iotests: Run iotest linters during Python CI John Snow
2021-10-04 21:04 ` [PATCH 01/13] iotests/297: Move pylint config into pylintrc John Snow
2021-10-13 10:49   ` Hanna Reitz
2021-10-04 21:04 ` [PATCH 02/13] iotests/297: Split mypy configuration out into mypy.ini John Snow
2021-10-13 10:53   ` Hanna Reitz
2021-10-13 14:37     ` John Snow
2021-10-04 21:04 ` [PATCH 03/13] iotests/297: Add get_files() function John Snow
2021-10-13 10:58   ` Hanna Reitz
2021-10-04 21:04 ` [PATCH 04/13] iotests/297: Don't rely on distro-specific linter binaries John Snow
2021-10-04 21:04 ` [PATCH 05/13] iotests/297: Create main() function John Snow
2021-10-13 11:03   ` Hanna Reitz
2021-10-13 14:41     ` John Snow
2021-10-04 21:04 ` [PATCH 06/13] iotests/297: Separate environment setup from test execution John Snow
2021-10-13 11:07   ` Hanna Reitz
2021-10-04 21:04 ` [PATCH 07/13] iotests/297: Split run_linters apart into run_pylint and run_mypy John Snow
2021-10-13 11:18   ` Hanna Reitz
2021-10-04 21:04 ` [PATCH 08/13] iotests/297: refactor run_[mypy|pylint] as generic execution shim John Snow
2021-10-13 11:26   ` Hanna Reitz
2021-10-04 21:04 ` [PATCH 09/13] iotests: split linters.py out from 297 John Snow
2021-10-13 11:50   ` Hanna Reitz
2021-10-13 15:07     ` John Snow
2021-10-13 16:28       ` Hanna Reitz
2021-10-04 21:05 ` [PATCH 10/13] iotests/linters: Add entry point for linting via Python CI John Snow
2021-10-13 12:11   ` Hanna Reitz
2021-10-13 15:11     ` John Snow
2021-10-04 21:05 ` [PATCH 11/13] iotests/linters: Add workaround for mypy bug #9852 John Snow
2021-10-13 12:15   ` Hanna Reitz
2021-10-04 21:05 ` [PATCH 12/13] python: Add iotest linters to test suite John Snow
2021-10-13 12:21   ` Hanna Reitz
2021-10-04 21:05 ` [PATCH 13/13] iotests: [RFC] drop iotest 297 John Snow
2021-10-13 12:23   ` Hanna Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.