aboutsummaryrefslogtreecommitdiff
path: root/docs/devel
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-01-27 19:02:03 +0000
committerPeter Maydell <peter.maydell@linaro.org>2021-01-27 19:02:03 +0000
commitaf47e82269f447b36549384323013765efd7e01c (patch)
tree32c06bed6793927f9d640c86f09d67567e5bd041 /docs/devel
parentbf159f0bdc7b8e7aa8342dedb3829ca744c1b612 (diff)
parentf8a9b4c66569cbc1640722369a91c635102b5264 (diff)
downloadqemu-af47e82269f447b36549384323013765efd7e01c.zip
qemu-af47e82269f447b36549384323013765efd7e01c.tar.gz
qemu-af47e82269f447b36549384323013765efd7e01c.tar.bz2
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2021-01-27' into staging
* Patches to speed up and improve the gitlab-CI * Documentation for the decorators in the "acceptance" tests * One small rework of a libqtest function # gpg: Signature made Wed 27 Jan 2021 06:22:11 GMT # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full] # gpg: aka "Thomas Huth <thuth@redhat.com>" [full] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [full] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth-gitlab/tags/pull-request-2021-01-27: libqtest: Rework qtest_rsp() docs/devel: Explain how acceptance tests can be skipped gitlab-ci.yml: Avoid recompiling the sources in the test jobs gitlab-ci.yml: Exclude some redundant targets in build-without-default-features meson: Do not build optional libraries by default configure: Only check for audio drivers if system-mode is selected gitlab-ci.yml: Avoid some submodules to speed up the CI a little bit gitlab-ci: Test building linux-user targets on CentOS 7 tests/docker: Install static libc package in CentOS 7 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'docs/devel')
-rw-r--r--docs/devel/testing.rst62
1 files changed, 62 insertions, 0 deletions
diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index 0aa7a13..9f8b77c 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 a 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.
+
+Here is a list of the most used 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 kind of assets.
+
+AVOCADO_TIMEOUT_EXPECTED
+~~~~~~~~~~~~~~~~~~~~~~~~
+The Avocado framework has a timeout mechanism which interrupts 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
--------------------