qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Gustavo Romero" <gustavo.romero@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	"Udo Steinberg" <udo@hypervisor.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Andrew Jones" <ajones@ventanamicro.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Shannon Zhao" <shannon.zhaosl@gmail.com>
Subject: Re: [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS
Date: Thu, 3 Apr 2025 20:04:35 +0200	[thread overview]
Message-ID: <7c417483-7d5d-456f-8187-56b5264f539e@redhat.com> (raw)
In-Reply-To: <20250403151829.44858-3-philmd@linaro.org>

On 03/04/2025 17.18, Philippe Mathieu-Daudé wrote:
> Since tests might be failing on some operating systems,
> introduce the skipIfOperatingSystem() decorator.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tests/functional/qemu_test/__init__.py   |  2 +-
>   tests/functional/qemu_test/decorators.py | 15 ++++++++++++++-
>   2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py
> index 45f7befa374..af41c2c6a22 100644
> --- a/tests/functional/qemu_test/__init__.py
> +++ b/tests/functional/qemu_test/__init__.py
> @@ -15,6 +15,6 @@
>   from .linuxkernel import LinuxKernelTest
>   from .decorators import skipIfMissingCommands, skipIfNotMachine, \
>       skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \
> -    skipIfMissingImports
> +    skipIfMissingImports, skipIfOperatingSystem
>   from .archive import archive_extract
>   from .uncompress import uncompress
> diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py
> index 1651eb739a7..b6a1d41c55c 100644
> --- a/tests/functional/qemu_test/decorators.py
> +++ b/tests/functional/qemu_test/decorators.py
> @@ -5,7 +5,7 @@
>   import importlib
>   import os
>   import platform
> -from unittest import skipUnless
> +from unittest import skipIf, skipUnless
>   
>   from .cmd import which
>   
> @@ -26,6 +26,19 @@ def skipIfMissingCommands(*args):
>       return skipUnless(has_cmds, 'required command(s) "%s" not installed' %
>                                   ", ".join(args))
>   
> +'''
> +Decorator to skip execution of a test if the current
> +host operating system does not match one of the permitted
> +ones.

"permitted ones" sounds like you'd need to specify the ones that are allowed 
to run the test, but it's rather the other way round, you have to specify 
the ones that are not able to run the test. I'd suggest to rewrite the 
comment accordingly.

> +Example
> +
> +  @skipIfOperatingSystem("Linux", "Darwin")
> +'''
> +def skipIfOperatingSystem(*args):
> +    return skipIf(platform.system() in args,
> +                  'not running on one of the required OS(s) "%s"' %

Same here, maybe rather: "running on an OS (%s) that is not able to run this 
test" ?

  Thomas



  parent reply	other threads:[~2025-04-03 18:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 15:18 [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 01/14] tests/functional/test_aarch64_rme_virt: fix sporadic failure Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 02/14] tests/functional: Add a decorator for skipping tests on particular OS Philippe Mathieu-Daudé
2025-04-03 17:31   ` Richard Henderson
2025-04-03 18:04   ` Thomas Huth [this message]
2025-04-03 20:27     ` Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0 v2 03/14] tests/functional: Skip aarch64_replay test on macOS Philippe Mathieu-Daudé
2025-04-03 17:31   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0 v2 04/14] tests/qtest: Skip Aarch64 VMapple machine Philippe Mathieu-Daudé
2025-04-03 17:33   ` Richard Henderson
2025-04-03 18:00   ` Thomas Huth
2025-04-03 15:18 ` [PATCH-for-10.0 v2 05/14] hw/arm: Do not build VMapple machine by default Philippe Mathieu-Daudé
2025-04-03 17:34   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 06/14] hw/arm/virt: Remove pointless VirtMachineState::tcg_its field Philippe Mathieu-Daudé
2025-04-03 17:36   ` Richard Henderson
2025-04-03 20:24     ` Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 07/14] hw/intc/gicv3_its: Do not check its_class_name() for NULL Philippe Mathieu-Daudé
2025-04-03 17:37   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 08/14] hw/arm/virt: Simplify create_its() Philippe Mathieu-Daudé
2025-04-03 17:38   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 09/14] hw/arm/virt-acpi: Factor its_enabled() helper out Philippe Mathieu-Daudé
2025-04-03 17:38   ` Richard Henderson
2025-04-03 15:18 ` [PATCH-for-10.0? v2 10/14] qtest/bios-tables-test: Add test for -M virt, its=off Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 11/14] qtest/bios-tables-test: Whitelist aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
2025-04-04 10:50   ` Igor Mammedov
2025-04-03 15:18 ` [PATCH-for-10.0? v2 12/14] hw/arm/virt-acpi: Always build IORT table (even with GIC ITS disabled) Philippe Mathieu-Daudé
2025-04-03 15:18 ` [PATCH-for-10.0? v2 13/14] hw/arm/virt-acpi: Do not advertise disabled GIC ITS Philippe Mathieu-Daudé
2025-04-04 10:41   ` Igor Mammedov
2025-04-04 12:49     ` Philippe Mathieu-Daudé
2025-05-06 15:49       ` Igor Mammedov
2025-04-03 15:18 ` [PATCH-for-10.0? v2 14/14] qtest/bios-tables-test: Update aarch64/virt 'its_off' variant blobs Philippe Mathieu-Daudé
2025-04-03 16:31 ` [PATCH-for-10.0 v2 00/14] hw/arm: Tests & ACPI tables fixes for 10.0 Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c417483-7d5d-456f-8187-56b5264f539e@redhat.com \
    --to=thuth@redhat.com \
    --cc=ajones@ventanamicro.com \
    --cc=alex.bennee@linaro.org \
    --cc=anisinha@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=gustavo.romero@linaro.org \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=udo@hypervisor.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).