[PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore

Thomas Huth posted 6 patches 4 years ago
Maintainers: Eduardo Habkost <eduardo@habkost.net>, Cleber Rosa <crosa@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
[PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore
Posted by Thomas Huth 4 years ago
Now that we add the single iotests directly in meson.build, we do
not have to separate the block suite from the other suites anymore.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build            | 6 +++---
 scripts/mtest2make.py  | 4 ----
 tests/Makefile.include | 9 +--------
 3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/meson.build b/meson.build
index 5f43355071..b203402ee1 100644
--- a/meson.build
+++ b/meson.build
@@ -3,9 +3,9 @@ project('qemu', ['c'], meson_version: '>=0.58.2',
                           'b_staticpic=false', 'stdsplit=false'],
         version: files('VERSION'))
 
-add_test_setup('quick', exclude_suites: ['block', 'slow', 'thorough'], is_default: true)
-add_test_setup('slow', exclude_suites: ['block', 'thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
-add_test_setup('thorough', exclude_suites: ['block'], env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
+add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
+add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
+add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
 
 not_found = dependency('', required: false)
 keyval = import('keyval')
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index 4d542e8aaa..304634b71e 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -101,10 +101,6 @@ def emit_suite(name, suite, prefix):
 testsuites = defaultdict(Suite)
 for test in introspect['tests']:
     process_tests(test, targets, testsuites)
-# HACK: check-block is a separate target so that it runs with --verbose;
-# only write the dependencies
-emit_suite_deps('block', testsuites['block'], 'check')
-del testsuites['block']
 emit_prolog(testsuites, 'check')
 for name, suite in testsuites.items():
     emit_suite(name, suite, 'check')
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 9157a57b1a..f93ae5b479 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -151,16 +151,9 @@ check-acceptance: check-acceptance-deprecated-warning | check-avocado
 
 # Consolidated targets
 
-.PHONY: check-block check check-clean get-vm-images
+.PHONY: check check-clean get-vm-images
 check:
 
-ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy)
-check: check-block
-check-block: run-ninja
-	$(if $(MAKE.n),,+)$(MESON) test $(MTESTARGS) $(.mtestargs) --verbose \
-		--logbase iotestslog $(call .speed.$(SPEED), block block-slow block-thorough)
-endif
-
 check-build: run-ninja
 
 check-clean:
-- 
2.27.0


Re: [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore
Posted by Peter Maydell 4 years ago
On Tue, 8 Feb 2022 at 10:18, Thomas Huth <thuth@redhat.com> wrote:
>
> Now that we add the single iotests directly in meson.build, we do
> not have to separate the block suite from the other suites anymore.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  meson.build            | 6 +++---
>  scripts/mtest2make.py  | 4 ----
>  tests/Makefile.include | 9 +--------
>  3 files changed, 4 insertions(+), 15 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 5f43355071..b203402ee1 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3,9 +3,9 @@ project('qemu', ['c'], meson_version: '>=0.58.2',
>                            'b_staticpic=false', 'stdsplit=false'],
>          version: files('VERSION'))
>
> -add_test_setup('quick', exclude_suites: ['block', 'slow', 'thorough'], is_default: true)
> -add_test_setup('slow', exclude_suites: ['block', 'thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
> -add_test_setup('thorough', exclude_suites: ['block'], env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
> +add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
> +add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
> +add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
>
>  not_found = dependency('', required: false)
>  keyval = import('keyval')
> diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
> index 4d542e8aaa..304634b71e 100644
> --- a/scripts/mtest2make.py
> +++ b/scripts/mtest2make.py
> @@ -101,10 +101,6 @@ def emit_suite(name, suite, prefix):
>  testsuites = defaultdict(Suite)
>  for test in introspect['tests']:
>      process_tests(test, targets, testsuites)
> -# HACK: check-block is a separate target so that it runs with --verbose;
> -# only write the dependencies
> -emit_suite_deps('block', testsuites['block'], 'check')
> -del testsuites['block']

This code being deleted claims to be doing something to ensure that
the tests get run and output the useful messages on failure.
What is the mechanism for this in the new meson setup ?
(As far as I can tell at the moment this is broken. At some
point I will start agitating for reverting that conversion if
it isn't fixed :-))

-- PMM

Re: [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore
Posted by Thomas Huth 4 years ago
On 08/02/2022 11.26, Peter Maydell wrote:
> On Tue, 8 Feb 2022 at 10:18, Thomas Huth <thuth@redhat.com> wrote:
>>
>> Now that we add the single iotests directly in meson.build, we do
>> not have to separate the block suite from the other suites anymore.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   meson.build            | 6 +++---
>>   scripts/mtest2make.py  | 4 ----
>>   tests/Makefile.include | 9 +--------
>>   3 files changed, 4 insertions(+), 15 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index 5f43355071..b203402ee1 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -3,9 +3,9 @@ project('qemu', ['c'], meson_version: '>=0.58.2',
>>                             'b_staticpic=false', 'stdsplit=false'],
>>           version: files('VERSION'))
>>
>> -add_test_setup('quick', exclude_suites: ['block', 'slow', 'thorough'], is_default: true)
>> -add_test_setup('slow', exclude_suites: ['block', 'thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
>> -add_test_setup('thorough', exclude_suites: ['block'], env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
>> +add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
>> +add_test_setup('slow', exclude_suites: ['thorough'], env: ['G_TEST_SLOW=1', 'SPEED=slow'])
>> +add_test_setup('thorough', env: ['G_TEST_SLOW=1', 'SPEED=thorough'])
>>
>>   not_found = dependency('', required: false)
>>   keyval = import('keyval')
>> diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
>> index 4d542e8aaa..304634b71e 100644
>> --- a/scripts/mtest2make.py
>> +++ b/scripts/mtest2make.py
>> @@ -101,10 +101,6 @@ def emit_suite(name, suite, prefix):
>>   testsuites = defaultdict(Suite)
>>   for test in introspect['tests']:
>>       process_tests(test, targets, testsuites)
>> -# HACK: check-block is a separate target so that it runs with --verbose;
>> -# only write the dependencies
>> -emit_suite_deps('block', testsuites['block'], 'check')
>> -del testsuites['block']
> 
> This code being deleted claims to be doing something to ensure that
> the tests get run and output the useful messages on failure.

No, AFAIK that --verbose switch just influences how meson prints the 
progress during the test runs (i.e. either a brief or a slightly more 
verbose output).

> What is the mechanism for this in the new meson setup ?

cat meson-logs/testlog.txt

... I guess we should either dump that to stdout or publish that file as a 
test artifact?

  Thomas


Re: [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore
Posted by Peter Maydell 4 years ago
On Tue, 8 Feb 2022 at 11:16, Thomas Huth <thuth@redhat.com> wrote:
>
> On 08/02/2022 11.26, Peter Maydell wrote:
> > What is the mechanism for this in the new meson setup ?
>
> cat meson-logs/testlog.txt
>
> ... I guess we should either dump that to stdout

Yes, it needs to actually appear in the stdout for CI jobs,
otherwise it is inaccessible and might as well not exist.
V=1 is the switch we have for "be verbose", and meson's
test facility should honour it.

thanks
-- PMM

Re: [PATCH 5/6] tests: Do not treat the iotests as separate meson test target anymore
Posted by Paolo Bonzini 4 years ago
On 2/8/22 12:16, Thomas Huth wrote:
>>
>> This code being deleted claims to be doing something to ensure that
>> the tests get run and output the useful messages on failure.
> 
> No, AFAIK that --verbose switch just influences how meson prints the 
> progress during the test runs (i.e. either a brief or a slightly more 
> verbose output).

I replied to another patch, but anyway here is Peter's report: 
https://patchew.org/QEMU/20220128101513.646792-1-pbonzini@redhat.com/#CAFEAcA_ttmvA0emS-41R5+k3w_KAbFvC30qdAShJfr7U+3q=CA@mail.gmail.com 
(I had not seen it until now).

Paolo