qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Ani Sinha <ani@anisinha.ca>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Thomas Huth <thuth@redhat.com>,
	 Peter Maydell <peter.maydell@linaro.org>,
	Daniel Berrange <berrange@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>,
	 Michael Tsirkin <mst@redhat.com>
Subject: Re: [PATCH v2 10/11] pytest: add pytest to the meson build system
Date: Mon, 11 Jul 2022 16:46:44 -0400	[thread overview]
Message-ID: <CAFn=p-b_uVDib7qFcy=6fsMCGrcY8hQ89ZsQAfQMuHO26WM1dg@mail.gmail.com> (raw)
In-Reply-To: <20220710170014.1673480-11-ani@anisinha.ca>

On Sun, Jul 10, 2022 at 1:01 PM Ani Sinha <ani@anisinha.ca> wrote:
>
> Integrate the pytest framework with the meson build system. This will make meson
> run all the pytests under the pytest directory.
>
> Signed-off-by: Ani Sinha <ani@anisinha.ca>
> ---
>  tests/Makefile.include   |  4 +++-
>  tests/meson.build        |  1 +
>  tests/pytest/meson.build | 49 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 53 insertions(+), 1 deletion(-)
>  create mode 100644 tests/pytest/meson.build
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 3accb83b13..40755a6bd1 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -3,12 +3,14 @@
>  .PHONY: check-help
>  check-help:
>         @echo "Regression testing targets:"
> -       @echo " $(MAKE) check                  Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
> +       @echo " $(MAKE) check                  Run block, qapi-schema, unit, softfloat, qtest, pytest and decodetree tests"

Does this mean that "make check" *requires* an internet connection? If
so, I'm afraid that introduces some complications for downstreams
which require that "make check" can run without an internet
connection. It's something I've been trying to wrestle with as I split
the qemu.qmp library out of the QEMU tree, and I have been working
(slowly) on remedying it with some additional Makefile logic.

I have been looking into making a testing "dummy package" for python
with optional dependency groups that use a venv building script to
either pull from PyPI in online mode, or use system packages in
offline mode. In the case of offline mode, I am working on augmenting
the configure script to test that dependencies are met, and disabling
test groups when the correct dependencies cannot be located.

I hope to have another version of that series soon; it should be
trivial to add a new optional dependency group to it. I'll CC you on
the next version of the series.

--js

>         @echo " $(MAKE) bench                  Run speed tests"
>         @echo
>         @echo "Individual test suites:"
>         @echo " $(MAKE) check-qtest-TARGET     Run qtest tests for given target"
>         @echo " $(MAKE) check-qtest            Run qtest tests"
> +       @echo " $(MAKE) check-pytest           Run pytest tests"
> +       @echo " $(MAKE) check-pytest-TARGET    Run pytest for a given target"
>         @echo " $(MAKE) check-unit             Run qobject tests"
>         @echo " $(MAKE) check-qapi-schema      Run QAPI schema tests"
>         @echo " $(MAKE) check-block            Run block tests"
> diff --git a/tests/meson.build b/tests/meson.build
> index 8e318ec513..f344cbdc6c 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -93,3 +93,4 @@ subdir('unit')
>  subdir('qapi-schema')
>  subdir('qtest')
>  subdir('migration')
> +subdir('pytest')
> diff --git a/tests/pytest/meson.build b/tests/pytest/meson.build
> new file mode 100644
> index 0000000000..e60d481ae4
> --- /dev/null
> +++ b/tests/pytest/meson.build
> @@ -0,0 +1,49 @@
> +slow_pytests = {
> +  'acpi-bits' : 120,
> +}
> +
> +pytests_generic = []
> +
> +# biosbits tests are currenly only supported on x86_64 platforms.
> +pytests_x86_64 = ['acpi-bits-test']
> +
> +pytest_executables = {}
> +other_deps = []
> +
> +subdir('acpi-bits')
> +
> +foreach dir : target_dirs
> +  if not dir.endswith('-softmmu')
> +    continue
> +  endif
> +
> +  target_base = dir.split('-')[0]
> +  pytest_emulator = emulators['qemu-system-' + target_base]
> +  target_pytests = get_variable('pytests_' + target_base, []) + pytests_generic
> +
> +  test_deps = roms
> +  pytest_env = environment()
> +  if have_tools
> +    pytest_env.set('QTEST_QEMU_IMG', './qemu-img')
> +    test_deps += [qemu_img]
> +  endif
> +  pytest_env.set('G_TEST_DBUS_DAEMON', meson.project_source_root() / 'tests/dbus-vmstate-daemon.sh')
> +  pytest_env.set('PYTEST_QEMU_BINARY', './qemu-system-' + target_base)
> +  pytest_env.set('PYTEST_SOURCE_ROOT', meson.project_source_root())
> +  if have_tools and have_vhost_user_blk_server
> +    pytest_env.set('PYTEST_QEMU_STORAGE_DAEMON_BINARY', './storage-daemon/qemu-storage-daemon')
> +    test_deps += [qsd]
> +  endif
> +
> +  foreach test : target_pytests
> +    test('pytest-@0@/@1@'.format(target_base, test),
> +         pytest_executables[test],
> +         depends: [test_deps, pytest_emulator, emulator_modules, other_deps],
> +         env: pytest_env,
> +         args: ['--tap', '-k'],
> +         protocol: 'tap',
> +         timeout: slow_pytests.get(test, 30),
> +         priority: slow_pytests.get(test, 30),
> +         suite: ['pytest', 'pytest-' + target_base])
> +  endforeach
> +endforeach
> --
> 2.25.1
>



  reply	other threads:[~2022-07-11 20:48 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 17:00 [PATCH v2 00/11] Introduce new acpi/smbios python tests using biosbits Ani Sinha
2022-07-10 17:00 ` [PATCH v2 01/11] acpi/tests/bits: initial commit of test scripts that are run by biosbits Ani Sinha
2022-07-11 20:38   ` John Snow
2022-07-12  7:17     ` Ani Sinha
2022-07-12 15:23       ` John Snow
2022-07-12 15:38         ` Ani Sinha
2022-07-12 15:42           ` John Snow
2022-07-12 15:46             ` Ani Sinha
2022-07-10 17:00 ` [PATCH v2 02/11] acpi/tests/bits: add SPDX license identifiers for bios bits tests Ani Sinha
2022-07-14 13:56   ` Daniel P. Berrangé
2022-07-14 14:12     ` Ani Sinha
2022-07-10 17:00 ` [PATCH v2 03/11] acpi/tests/bits: disable acpi PSS tests that are failing in biosbits Ani Sinha
2022-07-10 17:00 ` [PATCH v2 04/11] acpi/tests/bits: add smilatency test suite from bits in order to disable it Ani Sinha
2022-07-10 17:00 ` [PATCH v2 05/11] acpi/tests/bits: add SPDX license identifiers for bios bits smilatency tests Ani Sinha
2022-07-10 17:00 ` [PATCH v2 06/11] acpi/tests/bits: disable smilatency test since it does not pass everytime Ani Sinha
2022-07-10 17:00 ` [PATCH v2 07/11] acpi/tests/bits: add python test that exercizes QEMU bios tables using biosbits Ani Sinha
2022-07-11 20:42   ` John Snow
2022-07-12  7:15     ` Ani Sinha
2022-09-06 13:05       ` Daniel P. Berrangé
2022-07-14 14:05   ` Daniel P. Berrangé
2022-07-14 14:19     ` Ani Sinha
2022-07-14 17:49       ` Ani Sinha
2022-07-14 20:43       ` Michael S. Tsirkin
2022-07-14 20:41   ` Michael S. Tsirkin
2022-07-15  4:17     ` Ani Sinha
2022-07-15  6:50       ` Michael S. Tsirkin
2022-07-16  6:36         ` Ani Sinha
2022-07-16 15:30           ` Michael S. Tsirkin
2022-07-25 18:02             ` Ani Sinha
2022-07-27 18:38               ` Ani Sinha
2022-09-16 16:00                 ` Ani Sinha
2022-09-17 20:28                   ` Michael S. Tsirkin
2022-09-27  8:13                     ` Ani Sinha
2022-09-27  8:33                       ` Daniel P. Berrangé
2022-09-27 10:07                         ` Ani Sinha
2022-09-27 10:18                           ` Daniel P. Berrangé
2022-09-27 10:24                             ` Ani Sinha
2022-09-27 11:42                             ` Ani Sinha
2022-09-27 14:05                               ` Ani Sinha
2022-09-27 15:45                                 ` Daniel P. Berrangé
2022-09-27 21:21                                   ` Michael S. Tsirkin
2022-09-28  8:31                                     ` Thomas Huth
2022-09-28  8:35                                       ` Daniel P. Berrangé
2022-09-28  9:47                                         ` Michael S. Tsirkin
2022-09-28  9:35                                       ` Michael S. Tsirkin
2022-09-28  9:39                                         ` Thomas Huth
2022-09-28  9:56                                           ` Michael S. Tsirkin
2022-10-06  7:58                                             ` Ani Sinha
2022-10-06  8:11                                               ` Ani Sinha
2022-10-06 10:18                                                 ` Ani Sinha
2022-09-27 21:19                           ` Michael S. Tsirkin
2022-09-27 21:18                         ` Michael S. Tsirkin
2022-09-28  3:08                           ` Ani Sinha
2022-09-28  3:58                             ` Michael S. Tsirkin
2022-09-28  6:06                               ` Ani Sinha
2022-10-06 12:12                                 ` Michael S. Tsirkin
2022-09-28  6:58                           ` Daniel P. Berrangé
2022-09-28  7:15                             ` Ani Sinha
2022-09-28  7:26                               ` Daniel P. Berrangé
2022-09-28  9:19                             ` Michael S. Tsirkin
2022-09-27 21:44   ` Paolo Bonzini
2022-09-27 22:09     ` Michael S. Tsirkin
2022-09-27 23:10       ` Paolo Bonzini
2022-09-28  5:53         ` Michael S. Tsirkin
2022-09-28  7:06       ` Daniel P. Berrangé
2022-09-28  7:43         ` Thomas Huth
2022-10-09  5:21           ` Ani Sinha
2022-10-09  6:30             ` Ani Sinha
2022-10-09 16:06           ` Ani Sinha
2022-07-10 17:00 ` [PATCH v2 08/11] acpi/tests/bits: add biosbits config file for running bios tests Ani Sinha
2022-07-10 17:00 ` [PATCH v2 09/11] acpi/tests/bits: add a README file describing bits pytests Ani Sinha
2022-07-10 17:00 ` [PATCH v2 10/11] pytest: add pytest to the meson build system Ani Sinha
2022-07-11 20:46   ` John Snow [this message]
2022-07-12  6:52     ` Ani Sinha
2022-09-06 13:10       ` Daniel P. Berrangé
2022-09-27 21:26         ` Michael S. Tsirkin
2022-09-28  7:32           ` Thomas Huth
2022-09-28  9:23             ` Michael S. Tsirkin
2022-07-10 17:00 ` [PATCH v2 11/11] MAINTAINERS: add myself as the maintainer for acpi biosbits pytests Ani Sinha
2022-07-11  9:33 ` [PATCH v2 00/11] Introduce new acpi/smbios python tests using biosbits Michael S. Tsirkin
2022-07-14 13:24   ` Peter Maydell
2022-09-06  6:26     ` Ani Sinha
2022-09-06  8:19       ` Michael S. Tsirkin
2022-09-06 13:15     ` Daniel P. Berrangé
2022-09-06 13:28       ` Ani Sinha
2022-09-06 13:30         ` Daniel P. Berrangé
2022-09-09 12:53           ` Ani Sinha
2022-09-06 14:03       ` Michael S. Tsirkin
2022-09-06 14:10         ` Daniel P. Berrangé
2022-09-06 14:19           ` 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='CAFn=p-b_uVDib7qFcy=6fsMCGrcY8hQ89ZsQAfQMuHO26WM1dg@mail.gmail.com' \
    --to=jsnow@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@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).