From: Cleber Rosa <crosa@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Beraldo Leal" <bleal@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
qemu-devel@nongnu.org,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Willian Rampazzo" <willianr@redhat.com>,
"Auger Eric" <eric.auger@redhat.com>,
qemu-s390x@nongnu.org, "Willian Rampazzo" <wrampazz@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: Re: [PATCH 8/8] Tests: add custom test jobs
Date: Fri, 16 Apr 2021 12:25:59 -0400 [thread overview]
Message-ID: <20210416162559.GE1914548@amachine.somewhere> (raw)
In-Reply-To: <e71737f7-4717-06ce-54c8-fbb82167dd8d@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 5363 bytes --]
On Fri, Apr 16, 2021 at 07:23:14AM +0200, Philippe Mathieu-Daudé wrote:
> Hi Cleber,
>
> On 4/15/21 11:51 PM, Cleber Rosa wrote:
> > Different users (or even companies) have different interests, and
> > may want to run a reduced set of tests during development, or a
> > larger set of tests during QE.
> >
> > To cover these use cases, some example (but functional) jobs are
> > introduced here:
> >
> > 1) acceptance-all-targets.py: runs all arch agnostic tests on all
> > built targets, unless there are conditions that make them not work
> > out of the box ATM, then run all tests that are specific to
> > predefined targets.
> >
> > 2) acceptance-kvm-only.py: runs only tests that require KVM and are
> > specific to the host architecture.
> >
> > 3) qtest-unit.py: runs a combination of qtest and unit tests (in
> > parallel).
> >
> > 4) qtest-unit-acceptance.py: runs a combineation of qtest, unit tests
>
> Typo "combination".
>
> > and acceptance tests (all of them in parallel)
> >
> > To run the first two manually, follow the example bellow:
> >
> > $ cd build
> > $ make check-venv
> > $ ./tests/venv/bin/python3 tests/jobs/acceptance-all-targets.py
> > $ ./tests/venv/bin/python3 tests/jobs/acceptance-kvm-only.py
> >
> > The third and fouth example depends on information coming from Meson,
> > so the easiest way to run it is:
> >
> > $ cd build
> > $ make check-qtest-unit
> > $ make check-qtest-unit-acceptance
> >
> > These are based on Avocado's Job API, a way to customize an Avocado
> > job execution beyond the possibilities of command line arguments.
> > For more Job API resources, please refer to:
> >
> > a) Job API Examples:
> > - https://github.com/avocado-framework/avocado/tree/master/examples/jobs
> >
> > b) Documentation about configurable features at the Job Level:
> > - https://avocado-framework.readthedocs.io/en/87.0/config/index.html
> >
> > c) Documentation about the TestSuite class
> > - https://avocado-framework.readthedocs.io/en/87.0/api/core/avocado.core.html#avocado.core.suite.TestSuite
> >
> > d) Documentation about the Job class
> > - https://avocado-framework.readthedocs.io/en/87.0/api/core/avocado.core.html#avocado.core.job.Job
> >
> > Signed-off-by: Cleber Rosa <crosa@redhat.com>
> > ---
> > configure | 2 +-
> > tests/Makefile.include | 8 ++++
> > tests/jobs/acceptance-all-targets.py | 67 ++++++++++++++++++++++++++++
> > tests/jobs/acceptance-kvm-only.py | 35 +++++++++++++++
> > tests/jobs/qtest-unit-acceptance.py | 31 +++++++++++++
> > tests/jobs/qtest-unit.py | 24 ++++++++++
> > tests/jobs/utils.py | 22 +++++++++
> > 7 files changed, 188 insertions(+), 1 deletion(-)
> > create mode 100644 tests/jobs/acceptance-all-targets.py
> > create mode 100644 tests/jobs/acceptance-kvm-only.py
> > create mode 100644 tests/jobs/qtest-unit-acceptance.py
> > create mode 100644 tests/jobs/qtest-unit.py
> > create mode 100644 tests/jobs/utils.py
>
> > +if __name__ == '__main__':
> > + sys.exit(main())
> > diff --git a/tests/jobs/acceptance-kvm-only.py b/tests/jobs/acceptance-kvm-only.py
> > new file mode 100644
> > index 0000000000..acdcbbe087
> > --- /dev/null
> > +++ b/tests/jobs/acceptance-kvm-only.py
> > @@ -0,0 +1,35 @@
> > +#!/usr/bin/env python3
> > +
> > +import os
> > +import sys
> > +
> > +# This comes from tests/acceptance/avocado_qemu/__init__.py and should
> > +# not be duplicated here. The solution is to have the "avocado_qemu"
> > +# code and "python/qemu" available during build
> > +BUILD_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
> > +if os.path.islink(os.path.dirname(os.path.dirname(__file__))):
> > + # The link to the acceptance tests dir in the source code directory
> > + lnk = os.path.dirname(os.path.dirname(__file__))
> > + #: The QEMU root source directory
> > + SOURCE_DIR = os.path.dirname(os.path.dirname(os.readlink(lnk)))
> > +else:
> > + SOURCE_DIR = BUILD_DIR
> > +sys.path.append(os.path.join(SOURCE_DIR, 'python'))
> > +
> > +from avocado.core.job import Job
> > +
> > +from qemu.accel import kvm_available
> > +
> > +
> > +def main():
> > + if not kvm_available():
> > + sys.exit(0)
> > +
> > + config = {'run.references': ['tests/acceptance/'],
> > + 'filter.by_tags.tags': ['accel:kvm,arch:%s' % os.uname()[4]]}
>
> If we want forks to use their own set of tags, it would be better to
> provide an uniform way, not adding new test entry point for each set
> of fork tags. Could we consume a YAML config file instead? And provide
> templates so forks could adapt to their needs?
>
> Thanks,
>
> Phil.
>
Yes, it should be possible indeed. BTW, starting this kind of
discussion is one of the main goals of this series.
With regards to your suggestion, I believe there's an audience and
value to this KVM only job. But, your idea of a YAML config file is
also very much valid.
Maybe even a job that retrieves the list of tags from a CI variable?
That could allow people to run jobs for different subset of tests at
"push" time, without the need to add committed changes to (YAML)
config files.
Cheers,
- Cleber.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-04-16 16:34 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 21:51 [PATCH 0/8] Tests: introduce custom jobs Cleber Rosa
2021-04-15 21:51 ` [PATCH 1/8] Acceptance Jobs: preserve the cache for pip on GitLab CI Cleber Rosa
2021-04-16 3:56 ` Thomas Huth
2021-04-16 15:39 ` Cleber Rosa
2021-04-15 21:51 ` [PATCH 2/8] Acceptance tests: do not try to reuse packages from the system Cleber Rosa
2021-04-16 5:07 ` Philippe Mathieu-Daudé
2021-04-16 15:39 ` Willian Rampazzo
2021-04-19 18:14 ` Wainer dos Santos Moschetta
2021-04-15 21:51 ` [PATCH 3/8] tests/acceptance/linux_ssh_mips_malta.py: drop identical setUp Cleber Rosa
2021-04-16 5:26 ` Philippe Mathieu-Daudé
2021-04-16 15:43 ` Cleber Rosa
2021-04-16 17:46 ` Philippe Mathieu-Daudé
2021-04-19 18:25 ` Wainer dos Santos Moschetta
2021-04-16 15:46 ` Willian Rampazzo
2021-04-16 15:41 ` Willian Rampazzo
2021-04-15 21:51 ` [PATCH 4/8] tests/acceptance/migration.py: cancel test if migration is not supported Cleber Rosa
2021-04-16 5:11 ` Philippe Mathieu-Daudé
2021-04-16 16:14 ` Cleber Rosa
2021-04-16 15:50 ` Willian Rampazzo
2021-04-19 18:46 ` Wainer dos Santos Moschetta
2021-04-15 21:51 ` [PATCH 5/8] tests/acceptance/cpu_queries.py: use the proper logging channels Cleber Rosa
2021-04-16 5:15 ` Philippe Mathieu-Daudé
2021-04-16 15:54 ` Willian Rampazzo
2021-04-16 16:17 ` Cleber Rosa
2021-04-16 15:54 ` Willian Rampazzo
2021-04-19 18:56 ` Wainer dos Santos Moschetta
2021-04-15 21:51 ` [PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests Cleber Rosa
2021-04-16 15:56 ` Willian Rampazzo
2021-04-19 19:07 ` Wainer dos Santos Moschetta
2021-04-15 21:51 ` [PATCH 7/8] tests/acceptance/migration.py: cancel test on s390x Cleber Rosa
2021-04-19 19:11 ` Wainer dos Santos Moschetta
2021-04-19 19:35 ` Willian Rampazzo
2021-04-15 21:51 ` [PATCH 8/8] Tests: add custom test jobs Cleber Rosa
2021-04-16 5:23 ` Philippe Mathieu-Daudé
2021-04-16 16:25 ` Cleber Rosa [this message]
2021-04-16 16:22 ` [PATCH 0/8] Tests: introduce custom jobs Paolo Bonzini
2021-04-16 16:42 ` Cleber Rosa
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=20210416162559.GE1914548@amachine.somewhere \
--to=crosa@redhat.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=bleal@redhat.com \
--cc=cohuck@redhat.com \
--cc=ehabkost@redhat.com \
--cc=eric.auger@redhat.com \
--cc=f4bug@amsat.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
--cc=willianr@redhat.com \
--cc=wrampazz@redhat.com \
/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).