From: Fabiano Rosas <farosas@suse.de>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH] tests/functional: Allow tests to be run individually
Date: Thu, 18 Dec 2025 09:10:10 -0300 [thread overview]
Message-ID: <87bjjw0z4t.fsf@suse.de> (raw)
In-Reply-To: <dbfcbfff-b2fd-4c23-82da-ad9eed22a812@redhat.com>
Thomas Huth <thuth@redhat.com> writes:
> On 16/12/2025 21.05, Fabiano Rosas wrote:
>> The functional tests currently don't allow a single test to be
>> selected for execution by dotted name, e.g:
>>
>> ../tests/functional/ppc64/test_pseries.py PseriesMachine.test_ppc64_linux_boot
>> ^
>> The issue is that the testcase.py main function passes the test
>> module's name as the second argument to unittest.main(), which makes
>> it ignore all other positional arguments (presumably because the
>> module is already the superset of all tests).
>>
>> After commit cac08383f0 ("tests/functional: expose sys.argv to
>> unittest.main"), the situation improves by passing the rest of the
>> argv from the command line invocation into unittest.main(), but it
>> still doesn't fix the issue. The short form options are now accepted,
>> so the -k option could be used to filter for a pattern, which is
>> useful, but not the same as listing the test names.
>>
>> Fix this by passing the test module name via the "module" argument to
>> unittest.main() and stop touching argv. The ways of invoking tests are
>> now as per unittests documentation (-k still works):
>>
>> Examples:
>> test_pseries.py - run default set of tests
>> test_pseries.py MyTestSuite - run suite 'MyTestSuite'
>> test_pseries.py MyTestCase.testSomething - run MyTestCase.testSomething
>> test_pseries.py MyTestCase - run all 'test*' test methods in MyTestCase
> Tested-by: Thomas Huth <thuth@redhat.com>
>
> If you've got some spare time, maybe you could also add some words about
> running individual sub-tests to docs/devel/testing/functional.rst ?
>
Ah, thanks for the reminder, I'll do it right away.
prev parent reply other threads:[~2025-12-18 12:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 20:05 [PATCH] tests/functional: Allow tests to be run individually Fabiano Rosas
2025-12-18 8:03 ` Thomas Huth
2025-12-18 12:10 ` Fabiano Rosas [this message]
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=87bjjw0z4t.fsf@suse.de \
--to=farosas@suse.de \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=philmd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.