All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/31] tests/functional: various improvements wrt assets/scratch files
@ 2024-12-11 17:26 Daniel P. Berrangé
  2024-12-11 17:26 ` [PATCH v2 01/31] tests/functional: remove many unused imports Daniel P. Berrangé
                   ` (30 more replies)
  0 siblings, 31 replies; 64+ messages in thread
From: Daniel P. Berrangé @ 2024-12-11 17:26 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Alex Bennée, Thomas Huth,
	Daniel P. Berrangé

This series is an attempt to bring a little more guaranteed order
to asset and scratch file handling in the functional tests. The
main highlights are:

 * Add custom @skipXXXXX decorators for common scenarios
   present in QEMU tests

 * Add helpers for creating file paths for various well
   known types of data, or well known locations, to avoid
   adhoc path manipulation

 * Add helpers to simplify uncompressing and extracting
   archives, from files downloaded as assets

The series overall has a neutral diffstat, but if you look at
just test files,  as opposed to the shared infra, you'll see
a significant reduction of lines of code in the tests, and I
believe its easier to read them with less boilerplate.

This is based on:

     https://gitlab.com/thuth/qemu.git tags/pull-request-2024-12-11

Changes in v2:

 * Put archive & uncompress helpers in their own files
 * Have archive_extract & uncompress directly handle
   assets and format detection
 * Drop has_cmd/has_cmds helpers in favour of 'which'
 * Drop obsolete tessract version check
 * Simplify 'which' impl
 * Replace 'run_cmd' with direct use of subprocess
 * Remove even more unused imports
 * Gracefully handle asset download failure by skipping tests
 * Drop redundant hardcoded ./contrib path in virtio GPU test
 * Various docs improvements to decorators
 * Drop formatting change to import statements

Daniel P. Berrangé (31):
  tests/functional: remove many unused imports
  tests/functional: resolve str(Asset) to cache file path
  tests/functional: remove duplicated 'which' function impl
  tests/functional: simplify 'which' implementation
  tests/functional: drop 'tesseract_available' helper
  tests/functional: introduce some helpful decorators
  tests/functional: switch to new test skip decorators
  tests/functional: drop 'has_cmd' and 'has_cmds' helpers
  tests/functional: add helpers for building file paths
  tests/functional: switch over to using self.log_file(...)
  tests/functional: switch over to using self.build_file(...)
  tests/functional: switch over to using self.data_file(...)
  tests/functional: switch over to using self.scratch_file()
  tests/functional: switch over to using self.socket_dir(...)
  tests/functional: remove redundant 'rmtree' call
  tests/functional: move archive handling into new archive.py file
  tests/functional: move uncompress handling into new uncompress.py file
  tests/functional: add common zip_extract helper
  tests/functional: add common deb_extract helper
  tests/functional: let cpio_extract accept filenames
  tests/functional: add a generalized archive_extract
  tests/functional: add 'archive_extract' to QemuBaseTest
  tests/functional: convert tests to new archive_extract helper
  tests/functional: add a generalized uncompress helper
  tests/functional: add 'uncompress' to QemuBaseTest
  tests/functional: convert tests to new uncompress helper
  tests/functional: drop back compat imports from utils.py
  tests/functional: replace 'run_cmd' with subprocess helpers
  tests/functional: remove now unused 'run_cmd' helper
  tests/functional: skip tests if assets are not available
  tests/functional: ignore errors when caching assets, except for 404

 tests/functional/qemu_test/__init__.py        |   9 +-
 tests/functional/qemu_test/archive.py         | 117 ++++++++++
 tests/functional/qemu_test/asset.py           |  26 ++-
 tests/functional/qemu_test/cmd.py             |  76 ++-----
 tests/functional/qemu_test/decorators.py      | 107 +++++++++
 tests/functional/qemu_test/linuxkernel.py     |  30 +--
 tests/functional/qemu_test/tesseract.py       |  21 +-
 tests/functional/qemu_test/testcase.py        | 205 ++++++++++++++++--
 tests/functional/qemu_test/tuxruntest.py      |  19 +-
 tests/functional/qemu_test/uncompress.py      |  83 +++++++
 tests/functional/qemu_test/utils.py           |  45 ----
 tests/functional/test_aarch64_aspeed.py       |  23 +-
 tests/functional/test_aarch64_raspi3.py       |   9 +-
 tests/functional/test_aarch64_raspi4.py       |  21 +-
 tests/functional/test_aarch64_sbsaref.py      |  12 +-
 .../functional/test_aarch64_sbsaref_alpine.py |   1 -
 .../test_aarch64_sbsaref_freebsd.py           |   1 -
 tests/functional/test_aarch64_virt.py         |  14 +-
 tests/functional/test_acpi_bits.py            | 124 ++++-------
 tests/functional/test_alpha_clipper.py        |   6 +-
 tests/functional/test_arm_aspeed.py           |  46 ++--
 tests/functional/test_arm_bflt.py             |  13 +-
 tests/functional/test_arm_bpim2u.py           |  44 ++--
 tests/functional/test_arm_canona1100.py       |  10 +-
 tests/functional/test_arm_collie.py           |   2 +-
 tests/functional/test_arm_cubieboard.py       |  40 ++--
 tests/functional/test_arm_emcraft_sf2.py      |   2 +-
 tests/functional/test_arm_integratorcp.py     |  28 +--
 tests/functional/test_arm_orangepi.py         |  60 +++--
 tests/functional/test_arm_raspi2.py           |  21 +-
 tests/functional/test_arm_smdkc210.py         |  18 +-
 tests/functional/test_arm_sx1.py              |   2 +-
 tests/functional/test_arm_vexpress.py         |  10 +-
 tests/functional/test_linux_initrd.py         |   7 +-
 tests/functional/test_m68k_mcf5208evb.py      |   8 +-
 tests/functional/test_m68k_nextcube.py        |  24 +-
 tests/functional/test_m68k_q800.py            |   5 +-
 .../functional/test_microblaze_s3adsp1800.py  |   9 +-
 .../test_microblazeel_s3adsp1800.py           |  10 +-
 tests/functional/test_mips64el_fuloong2e.py   |  10 +-
 tests/functional/test_mips64el_loongson3v.py  |   8 +-
 tests/functional/test_mips64el_malta.py       |  45 ++--
 tests/functional/test_mips_malta.py           |  19 +-
 tests/functional/test_mipsel_malta.py         |  24 +-
 tests/functional/test_or1k_sim.py             |   7 +-
 tests/functional/test_ppc64_e500.py           |   7 +-
 tests/functional/test_ppc64_hv.py             |  39 +---
 tests/functional/test_ppc64_tuxrun.py         |   7 +-
 tests/functional/test_ppc_40p.py              |   7 +-
 tests/functional/test_ppc_amiga.py            |  20 +-
 tests/functional/test_ppc_bamboo.py           |  15 +-
 tests/functional/test_ppc_mac.py              |   8 +-
 tests/functional/test_ppc_mpc8544ds.py        |   8 +-
 tests/functional/test_ppc_virtex_ml507.py     |  10 +-
 tests/functional/test_rx_gdbsim.py            |  13 +-
 tests/functional/test_s390x_ccw_virtio.py     |   6 +-
 tests/functional/test_s390x_topology.py       |   7 +-
 tests/functional/test_sh4_r2d.py              |  14 +-
 tests/functional/test_sh4eb_r2d.py            |  14 +-
 tests/functional/test_sparc64_sun4u.py        |  11 +-
 tests/functional/test_sparc_sun4m.py          |   7 +-
 tests/functional/test_virtio_gpu.py           |  16 +-
 tests/functional/test_xtensa_lx60.py          |   8 +-
 tests/lcitool/libvirt-ci                      |   2 +-
 64 files changed, 885 insertions(+), 755 deletions(-)
 create mode 100644 tests/functional/qemu_test/archive.py
 create mode 100644 tests/functional/qemu_test/decorators.py
 create mode 100644 tests/functional/qemu_test/uncompress.py

-- 
2.46.0



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

end of thread, other threads:[~2024-12-13  9:14 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 17:26 [PATCH v2 00/31] tests/functional: various improvements wrt assets/scratch files Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 01/31] tests/functional: remove many unused imports Daniel P. Berrangé
2024-12-11 19:31   ` Thomas Huth
2024-12-12  9:12     ` Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 02/31] tests/functional: resolve str(Asset) to cache file path Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 03/31] tests/functional: remove duplicated 'which' function impl Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 04/31] tests/functional: simplify 'which' implementation Daniel P. Berrangé
2024-12-11 19:32   ` Thomas Huth
2024-12-11 20:50   ` Richard Henderson
2024-12-11 17:26 ` [PATCH v2 05/31] tests/functional: drop 'tesseract_available' helper Daniel P. Berrangé
2024-12-12  6:57   ` Thomas Huth
2024-12-12  9:35     ` Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 06/31] tests/functional: introduce some helpful decorators Daniel P. Berrangé
2024-12-12  7:01   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 07/31] tests/functional: switch to new test skip decorators Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 08/31] tests/functional: drop 'has_cmd' and 'has_cmds' helpers Daniel P. Berrangé
2024-12-12  7:12   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 09/31] tests/functional: add helpers for building file paths Daniel P. Berrangé
2024-12-12  9:01   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 10/31] tests/functional: switch over to using self.log_file(...) Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 11/31] tests/functional: switch over to using self.build_file(...) Daniel P. Berrangé
2024-12-12  9:42   ` Thomas Huth
2024-12-12  9:52     ` Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 12/31] tests/functional: switch over to using self.data_file(...) Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 13/31] tests/functional: switch over to using self.scratch_file() Daniel P. Berrangé
2024-12-12  9:33   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 14/31] tests/functional: switch over to using self.socket_dir(...) Daniel P. Berrangé
2024-12-12  9:36   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 15/31] tests/functional: remove redundant 'rmtree' call Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 16/31] tests/functional: move archive handling into new archive.py file Daniel P. Berrangé
2024-12-12  9:38   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 17/31] tests/functional: move uncompress handling into new uncompress.py file Daniel P. Berrangé
2024-12-12  9:43   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 18/31] tests/functional: add common zip_extract helper Daniel P. Berrangé
2024-12-12  9:49   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 19/31] tests/functional: add common deb_extract helper Daniel P. Berrangé
2024-12-12  9:54   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 20/31] tests/functional: let cpio_extract accept filenames Daniel P. Berrangé
2024-12-12  9:57   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 21/31] tests/functional: add a generalized archive_extract Daniel P. Berrangé
2024-12-12 10:19   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 22/31] tests/functional: add 'archive_extract' to QemuBaseTest Daniel P. Berrangé
2024-12-12 10:22   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 23/31] tests/functional: convert tests to new archive_extract helper Daniel P. Berrangé
2024-12-12 10:34   ` Thomas Huth
2024-12-12 10:44     ` Daniel P. Berrangé
2024-12-11 17:26 ` [PATCH v2 24/31] tests/functional: add a generalized uncompress helper Daniel P. Berrangé
2024-12-12 10:36   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 25/31] tests/functional: add 'uncompress' to QemuBaseTest Daniel P. Berrangé
2024-12-12 10:43   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 26/31] tests/functional: convert tests to new uncompress helper Daniel P. Berrangé
2024-12-12 11:03   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 27/31] tests/functional: drop back compat imports from utils.py Daniel P. Berrangé
2024-12-12 11:04   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 28/31] tests/functional: replace 'run_cmd' with subprocess helpers Daniel P. Berrangé
2024-12-12 11:11   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 29/31] tests/functional: remove now unused 'run_cmd' helper Daniel P. Berrangé
2024-12-12 11:12   ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 30/31] tests/functional: skip tests if assets are not available Daniel P. Berrangé
2024-12-12 14:14   ` Thomas Huth
2024-12-12 15:02     ` Daniel P. Berrangé
2024-12-13  9:10       ` Thomas Huth
2024-12-11 17:26 ` [PATCH v2 31/31] tests/functional: ignore errors when caching assets, except for 404 Daniel P. Berrangé
2024-12-13  9:13   ` Thomas Huth

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.