mbox series

[0/6] patchtest: cleanups and fixes, part 1

Message ID 20260526193317.807459-1-tgamblin@baylibre.com
Headers show
Series patchtest: cleanups and fixes, part 1 | expand

Message

Trevor Gamblin May 26, 2026, 7:33 p.m. UTC
This is the first split of patches coming from a previous series[1] I submitted.
Compared to that version, the changes here are mostly refactors to do the
following:

- Make sure that patchtest errors early if the user tries to run it without the
  meta-selftest layer enabled
- Improve the signal-handling logic when the --directory flag is used in a test
  run
- Encapsulate some bits (like package name fetching) into functions which might
  be re-used elsewhere
- Improve function and variable naming
- remove unnecessary code where possible
- Fix vague comments and typos/grammatical issues

Note that this was driven partially by Claude Code (Sonnet 4.6 and 4.7), but
I've gone back and reworked some of its changes before submission.

Selftests look OK after these changes:

|============================================================================
|Testsuite summary for patchtest
|============================================================================
|# TOTAL: 38
|# XPASS: 18
|# XFAIL: 18
|# XSKIP: 2
|# PASS: 0
|# FAIL: 0
|# SKIP: 0
|# ERROR: 0
|============================================================================

[1]: https://lists.openembedded.org/g/openembedded-core/message/237047

Trevor Gamblin (6):
  patchtest: refactor and simplify script
  patchtest: check for meta-selftest
  patchtest: tests: cleanup test suites
  patchtest: correctly abort --directory test
  patchtest: tests: base: add helper functions, cleanup
  patchtest: tests: test_metadata: cleanup

 meta/lib/patchtest/patchtest_parser.py        |   2 +-
 meta/lib/patchtest/repo.py                    |   4 +
 meta/lib/patchtest/tests/base.py              | 116 ++++-------
 meta/lib/patchtest/tests/test_mbox.py         |  10 +-
 meta/lib/patchtest/tests/test_metadata.py     |  88 ++++----
 meta/lib/patchtest/tests/test_patch.py        |  33 ++-
 .../lib/patchtest/tests/test_python_pylint.py |   8 +-
 scripts/patchtest                             | 197 +++++++++---------
 8 files changed, 206 insertions(+), 252 deletions(-)