On Fri, Jul 18, 2025 at 12:20 PM Daniel P. Berrangé <berra...@redhat.com> wrote:
>
> On Thu, Jul 17, 2025 at 01:34:13PM +0300, Manos Pitsidianakis wrote:
> > Add argument parsing to functional tests to improve developer experience
> > when running individual tests. All logs are printed to stdout
> > interspersed with TAP output.
> >
> > Example usage, assuming current build directory with qemu source code in
> > the parent directory (see docs/devel/testing/functional.rst for details):
> >
> >   $ export PYTHONPATH=../python:../tests/functional
> >   $ export QEMU_TEST_QEMU_BINARY="$(pwd)/qemu-system-aarch64"
> >   $ ./pyvenv/bin/python3 ../tests/functional/test_aarch64_virt.py --help
> >   usage: test_aarch64_virt [-h] [-d]
> >
> >   QEMU Functional test
> >
> >   options:
> >     -h, --help   show this help message and exit
> >     -d, --debug  Also print test and console logs on stdout. This will
> >                  make the TAP output invalid and is meant for debugging
> >                  only.
> >
> > Signed-off-by: Manos Pitsidianakis <manos.pitsidiana...@linaro.org>
> > ---
> > Changes in v2:
> > - Store stdout handler in `self` object (thanks Daniel)
> > - Deduplicate handler removal code (Daniel)
> > - Amend commit description to mention PYTHONPATH (thanks Alex)
> > - Link to v1: 
> > https://lore.kernel.org/qemu-devel/20250716-functional_tests_debug_arg-v1-1-6a9cd6831...@linaro.org
>
> You've ignored my v1 review requests that the code for creating
> log handlers should be moved into a helper method in util.py, and
> likewise that the argparse code moved into util.py, and thus not
> called in both main & setUp.

Hi Daniel,

I forgot to reply to those comments. The arg parsing logic needs to be
called from both, as explained in the comment. Plus, there's no reason
to put it in the util module, it's only used in one file. It doesn't
really help to split stuff out of testcase.py if they are only called
from that file, plus it's not a big file in the first place.

>
>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>

-- 
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd

Reply via email to