* [PATCH] docs/devel: Explain how acceptance tests can be skipped
@ 2021-01-13 19:52 Wainer dos Santos Moschetta
2021-01-14 8:22 ` Thomas Huth
0 siblings, 1 reply; 3+ messages in thread
From: Wainer dos Santos Moschetta @ 2021-01-13 19:52 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, thuth, philmd, wrampazz, crosa
Documented under the "Acceptance tests using the Avocado Framework"
section in testing.rst how environment variables are used to skip tests.
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
---
CI (success): https://gitlab.com/wainersm/qemu/-/pipelines/241249714
docs/devel/testing.rst | 62 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 0aa7a13bba..3cdb458565 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -871,6 +871,68 @@ qemu_bin
The exact QEMU binary to be used on QEMUMachine.
+Skipping tests
+--------------
+The Avocado framework provides Python decorators which allow for easily skip
+tests running under certain conditions. For example, on the lack of a binary
+on the test system or when the running environment is an CI system. For further
+information about those decorators, please refer to::
+
+ https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#skipping-tests
+
+While the conditions for skipping tests are often specifics of each one, there
+are recurring scenarios identified by the QEMU developers and the use of
+environment variables became a kind of standard way to enable/disable tests.
+
+It follows a not comprehensive list of those variables.
+
+AVOCADO_ALLOW_LARGE_STORAGE
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Tests which are going to fetch or produce assets considered *large* are not
+going to run unless that `AVOCADO_ALLOW_LARGE_STORAGE=1` is exported on
+the environment.
+
+The definition of *large* is a bit arbitrary here, but it usually means an
+asset which occupies at least 1GB of size on disk when uncompressed.
+
+AVOCADO_ALLOW_UNTRUSTED_CODE
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+There are tests which will boot a kernel image or firmware that can be
+considered not safe to run on the developer's workstation, thus they are
+skipped by default. The definition of *not safe* is also arbitrary but
+usually it means a blob which either its source or build process aren't
+public available.
+
+You should export `AVOCADO_ALLOW_UNTRUSTED_CODE=1` on the environment in
+order to allow tests which make use of those assets to get running.
+
+AVOCADO_TIMEOUT_EXPECTED
+~~~~~~~~~~~~~~~~~~~~~~~~
+The Avocado framework has a timeout mechanism which interrupt tests to avoid the
+test suite of getting stuck. The timeout value can be set via test parameter or
+property defined in the test class, for further details::
+
+ https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#setting-a-test-timeout
+
+Even though the timeout can be set by the test developer, there are some tests
+that may not have a well-defined limit of time to finish under certain
+conditions. For example, tests that take longer to execute when QEMU is
+compiled with debug flags. Therefore, the `AVOCADO_TIMEOUT_EXPECTED` variable
+has been used to determine whether those tests should run or not.
+
+GITLAB_CI
+~~~~~~~~~
+A number of tests are flagged to not run on the GitLab CI. Usually because
+they proved to the flaky or there are constraints on the CI environment which
+would make them fail. If you encounter a similar situation then use that
+variable as shown on the code snippet below to skip the test:
+
+.. code::
+
+ @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
+ def test(self):
+ do_something()
+
Uninstalling Avocado
--------------------
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] docs/devel: Explain how acceptance tests can be skipped
2021-01-13 19:52 [PATCH] docs/devel: Explain how acceptance tests can be skipped Wainer dos Santos Moschetta
@ 2021-01-14 8:22 ` Thomas Huth
2021-01-14 10:30 ` Alex Bennée
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2021-01-14 8:22 UTC (permalink / raw)
To: Wainer dos Santos Moschetta, qemu-devel
Cc: philmd, alex.bennee, wrampazz, crosa
On 13/01/2021 20.52, Wainer dos Santos Moschetta wrote:
> Documented under the "Acceptance tests using the Avocado Framework"
> section in testing.rst how environment variables are used to skip tests.
>
> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> ---
> CI (success): https://gitlab.com/wainersm/qemu/-/pipelines/241249714
>
> docs/devel/testing.rst | 62 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
>
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 0aa7a13bba..3cdb458565 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -871,6 +871,68 @@ qemu_bin
>
> The exact QEMU binary to be used on QEMUMachine.
>
> +Skipping tests
> +--------------
> +The Avocado framework provides Python decorators which allow for easily skip
> +tests running under certain conditions. For example, on the lack of a binary
> +on the test system or when the running environment is an CI system. For further
s/is an CI/is a CI/
> +information about those decorators, please refer to::
> +
> + https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#skipping-tests
> +
> +While the conditions for skipping tests are often specifics of each one, there
> +are recurring scenarios identified by the QEMU developers and the use of
> +environment variables became a kind of standard way to enable/disable tests.
> +
> +It follows a not comprehensive list of those variables.
s/It follows a/Here is a/ ?
> +AVOCADO_ALLOW_LARGE_STORAGE
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +Tests which are going to fetch or produce assets considered *large* are not
> +going to run unless that `AVOCADO_ALLOW_LARGE_STORAGE=1` is exported on
> +the environment.
> +
> +The definition of *large* is a bit arbitrary here, but it usually means an
> +asset which occupies at least 1GB of size on disk when uncompressed.
> +
> +AVOCADO_ALLOW_UNTRUSTED_CODE
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +There are tests which will boot a kernel image or firmware that can be
> +considered not safe to run on the developer's workstation, thus they are
> +skipped by default. The definition of *not safe* is also arbitrary but
> +usually it means a blob which either its source or build process aren't
> +public available.
> +
> +You should export `AVOCADO_ALLOW_UNTRUSTED_CODE=1` on the environment in
> +order to allow tests which make use of those assets to get running.
maybe better: "... which make use of those kind of assets." ?
> +AVOCADO_TIMEOUT_EXPECTED
> +~~~~~~~~~~~~~~~~~~~~~~~~
> +The Avocado framework has a timeout mechanism which interrupt tests to avoid the
s/interrupt/interrupts/
> +test suite of getting stuck. The timeout value can be set via test parameter or
> +property defined in the test class, for further details::
> +
> + https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#setting-a-test-timeout
> +
> +Even though the timeout can be set by the test developer, there are some tests
> +that may not have a well-defined limit of time to finish under certain
> +conditions. For example, tests that take longer to execute when QEMU is
> +compiled with debug flags. Therefore, the `AVOCADO_TIMEOUT_EXPECTED` variable
> +has been used to determine whether those tests should run or not.
> +
> +GITLAB_CI
> +~~~~~~~~~
> +A number of tests are flagged to not run on the GitLab CI. Usually because
> +they proved to the flaky or there are constraints on the CI environment which
> +would make them fail. If you encounter a similar situation then use that
> +variable as shown on the code snippet below to skip the test:
> +
> +.. code::
> +
> + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
> + def test(self):
> + do_something()
> +
> Uninstalling Avocado
> --------------------
>
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] docs/devel: Explain how acceptance tests can be skipped
2021-01-14 8:22 ` Thomas Huth
@ 2021-01-14 10:30 ` Alex Bennée
0 siblings, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2021-01-14 10:30 UTC (permalink / raw)
To: Thomas Huth
Cc: wrampazz, philmd, qemu-devel, Wainer dos Santos Moschetta, crosa
Thomas Huth <thuth@redhat.com> writes:
> On 13/01/2021 20.52, Wainer dos Santos Moschetta wrote:
>> Documented under the "Acceptance tests using the Avocado Framework"
>> section in testing.rst how environment variables are used to skip tests.
>>
>> Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
>> ---
>> CI (success): https://gitlab.com/wainersm/qemu/-/pipelines/241249714
>>
>> docs/devel/testing.rst | 62 ++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 62 insertions(+)
>>
>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
>> index 0aa7a13bba..3cdb458565 100644
>> --- a/docs/devel/testing.rst
>> +++ b/docs/devel/testing.rst
>> @@ -871,6 +871,68 @@ qemu_bin
>>
>> The exact QEMU binary to be used on QEMUMachine.
>>
>> +Skipping tests
>> +--------------
>> +The Avocado framework provides Python decorators which allow for easily skip
>> +tests running under certain conditions. For example, on the lack of a binary
>> +on the test system or when the running environment is an CI system. For further
>
> s/is an CI/is a CI/
>
>> +information about those decorators, please refer to::
>> +
>> + https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#skipping-tests
>> +
>> +While the conditions for skipping tests are often specifics of each one, there
>> +are recurring scenarios identified by the QEMU developers and the use of
>> +environment variables became a kind of standard way to enable/disable tests.
>> +
>> +It follows a not comprehensive list of those variables.
>
> s/It follows a/Here is a/ ?
There now follows a non-comprehensive list of those variables:
?
I'm not sure if that is idiomatic international English or just British
English - it's usually a phrase that precedes our party political
broadcasts on TV ;-)
>
>> +AVOCADO_ALLOW_LARGE_STORAGE
>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> +Tests which are going to fetch or produce assets considered *large* are not
>> +going to run unless that `AVOCADO_ALLOW_LARGE_STORAGE=1` is exported on
>> +the environment.
>> +
>> +The definition of *large* is a bit arbitrary here, but it usually means an
>> +asset which occupies at least 1GB of size on disk when uncompressed.
>> +
>> +AVOCADO_ALLOW_UNTRUSTED_CODE
>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> +There are tests which will boot a kernel image or firmware that can be
>> +considered not safe to run on the developer's workstation, thus they are
>> +skipped by default. The definition of *not safe* is also arbitrary but
>> +usually it means a blob which either its source or build process aren't
>> +public available.
>> +
>> +You should export `AVOCADO_ALLOW_UNTRUSTED_CODE=1` on the environment in
>> +order to allow tests which make use of those assets to get running.
>
> maybe better: "... which make use of those kind of assets." ?
>
>> +AVOCADO_TIMEOUT_EXPECTED
>> +~~~~~~~~~~~~~~~~~~~~~~~~
>> +The Avocado framework has a timeout mechanism which interrupt tests to avoid the
>
> s/interrupt/interrupts/
>
>> +test suite of getting stuck. The timeout value can be set via test parameter or
>> +property defined in the test class, for further details::
>> +
>> + https://avocado-framework.readthedocs.io/en/latest/guides/writer/chapters/writing.html#setting-a-test-timeout
>> +
>> +Even though the timeout can be set by the test developer, there are some tests
>> +that may not have a well-defined limit of time to finish under certain
>> +conditions. For example, tests that take longer to execute when QEMU is
>> +compiled with debug flags. Therefore, the `AVOCADO_TIMEOUT_EXPECTED` variable
>> +has been used to determine whether those tests should run or not.
>> +
>> +GITLAB_CI
>> +~~~~~~~~~
>> +A number of tests are flagged to not run on the GitLab CI. Usually because
>> +they proved to the flaky or there are constraints on the CI environment which
>> +would make them fail. If you encounter a similar situation then use that
>> +variable as shown on the code snippet below to skip the test:
>> +
>> +.. code::
>> +
>> + @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
>> + def test(self):
>> + do_something()
>> +
>> Uninstalling Avocado
>> --------------------
>>
>
> Thomas
--
Alex Bennée
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-14 10:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 19:52 [PATCH] docs/devel: Explain how acceptance tests can be skipped Wainer dos Santos Moschetta
2021-01-14 8:22 ` Thomas Huth
2021-01-14 10:30 ` Alex Bennée
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).