[PATCH 7/9] Avocado tests: improve documentation on tag filtering

Cleber Rosa posted 9 patches 3 years, 11 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Cleber Rosa <crosa@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Antony Pavlov <antonynpavlov@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Fabien Chouteau <chouteau@adacore.com>, KONRAD Frederic <frederic.konrad@adacore.com>, "Hervé Poussineau" <hpoussin@reactos.org>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Paolo Bonzini <pbonzini@redhat.com>, Eric Auger <eric.auger@redhat.com>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
[PATCH 7/9] Avocado tests: improve documentation on tag filtering
Posted by Cleber Rosa 3 years, 11 months ago
It's possible to filter based on a combination of criteria.  This adds
examples to the documentation.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 docs/devel/testing.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 92d40cdd19..f5b6e07b5c 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -936,6 +936,28 @@ in the current directory, tagged as "quick", run:
 
   avocado run -t quick .
 
+To run tests with a given value for a given tag, such as having the
+``accel`` tag set to ``kvm``, run:
+
+.. code::
+
+  avocado run -t accel:kvm .
+
+Multiple mandatory conditions can also be given.  To run only tests
+with ``arch`` set to ``x86_64`` and ``accell`` set to ``kvm``, run:
+
+.. code::
+
+  avocado run -t arch:x86_64,accel:kvm .
+
+It's also possible to exclude tests that contain a given value for a
+tag.  To list all tests that do *not* have ``arch`` set to ``x86_64``,
+run:
+
+.. code::
+
+  avocado run -t arch:-x86_64 .
+
 The ``avocado_qemu.Test`` base test class
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-- 
2.35.1


Re: [PATCH 7/9] Avocado tests: improve documentation on tag filtering
Posted by Thomas Huth 3 years, 11 months ago
On 25/02/2022 22.01, Cleber Rosa wrote:
> It's possible to filter based on a combination of criteria.  This adds
> examples to the documentation.
> 
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   docs/devel/testing.rst | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
> 
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 92d40cdd19..f5b6e07b5c 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -936,6 +936,28 @@ in the current directory, tagged as "quick", run:
>   
>     avocado run -t quick .
>   
> +To run tests with a given value for a given tag, such as having the
> +``accel`` tag set to ``kvm``, run:
> +
> +.. code::
> +
> +  avocado run -t accel:kvm .
> +
> +Multiple mandatory conditions can also be given.  To run only tests
> +with ``arch`` set to ``x86_64`` and ``accell`` set to ``kvm``, run:

s/accell/accel/

> +
> +.. code::
> +
> +  avocado run -t arch:x86_64,accel:kvm .
> +
> +It's also possible to exclude tests that contain a given value for a

Just a matter of taste, I guess, but I'd prefer "It is" instead of "It's" in 
the documentation.

> +tag.  To list all tests that do *not* have ``arch`` set to ``x86_64``,
> +run:
> +
> +.. code::
> +
> +  avocado run -t arch:-x86_64 .
> +
>   The ``avocado_qemu.Test`` base test class
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

With at least "accell" fixed:
Reviewed-by: Thomas Huth <thuth@redhat.com>