[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 00/23] Convert avocado tests to normal Python unittests
From: |
Cleber Rosa |
Subject: |
Re: [PATCH v2 00/23] Convert avocado tests to normal Python unittests |
Date: |
Fri, 26 Jul 2024 09:50:03 -0400 |
On Fri, Jul 26, 2024 at 9:04 AM Thomas Huth <thuth@redhat.com> wrote:
>
> On 25/07/2024 13.07, Daniel P. Berrangé wrote:
> > On Thu, Jul 25, 2024 at 08:42:31PM +1000, Richard Henderson wrote:
> >> On 7/25/24 19:55, Daniel P. Berrangé wrote:
> >>> On Thu, Jul 25, 2024 at 09:35:22AM +1000, Richard Henderson wrote:
> ...
> >> Avocado runs a first pass doing all of the downloads, and only afterward
> >> runs the actual timed tests. I don't know the specifics of how, but it
> >> certainly obvious in the logging.
> >
> > Oh interesting, I found how it does it..
> >
> > The file avocado/plugins/assets.py will build an AST of the python
> > code in a test file, look for all 'fetch_asset' calls, then extract
> > the parameters to these calls, and donwload them. This is clever.
> > Basically avoids the refactoring that I suggested.
> >
> > So yeah, that is a gap.
> >
> > Practically speaking, we have a choice of either calling into this
> > avocado python lib as is, or copying tthat python lib into QEMU.
>
> Honestly, I'd prefer to do some refactoring instead, something like you
> suggested in your earlier mail. Rationale: For the basic tests it would be
> good if we would not depend on the Avacodo framework anymore, otherwise we
> likely will continue to run into the situation that our test framework stops
> working on some random new python versions and nobody within the QEMU
> community has a clue how to fix the situation since nobody is really
> familiar with the Avocado framework. Also, while that
> avocado/plugins/assets.py sounds like a very neat trick done by a skilled
> Python wizard, the average QEMU developer (like me) is just a skilled C
> coder with only basic Python knowledge, so I'd prefer if we could use a
> simpler mechanism instead that is easier to understand and to debug for
> everybody once we run into problems with it.
>
Hi Thomas,
That wizardry is indeed not nice, and has limitations. It was
replaced in recent Avocado versions for the dependencies mechanism:
https://avocado-framework.readthedocs.io/en/103.0/guides/user/chapters/dependencies.html
Specifically for the assets (downloadable files), you can find the
documentation here:
https://avocado-framework.readthedocs.io/en/103.0/guides/user/chapters/dependencies.html#asset
Those are superior to the previous implementation because they compute
a dependency graph that works on the resolution while tests with
dependencies met (or no deps) start running right away.
Regards,
- Cleber.
- [PATCH v2 19/23] tests/functional: Convert the ppc_hv avocado test into a standalone test, (continued)
- [PATCH v2 19/23] tests/functional: Convert the ppc_hv avocado test into a standalone test, Thomas Huth, 2024/07/24
- [PATCH v2 20/23] tests/functional: Convert the m68k nextcube test with tesseract, Thomas Huth, 2024/07/24
- [PATCH v2 21/23] tests/functional: Convert the acpi-bits test into a standalone test, Thomas Huth, 2024/07/24
- [PATCH v2 22/23] tests/functional: Convert the rx_gdbsim avocado test into a standalone test, Thomas Huth, 2024/07/24
- [PATCH v2 23/23] gitlab-ci: Add "check-functional" to the build tests, Thomas Huth, 2024/07/24
- Re: [PATCH v2 00/23] Convert avocado tests to normal Python unittests, Richard Henderson, 2024/07/24
Re: [PATCH v2 00/23] Convert avocado tests to normal Python unittests, Thomas Huth, 2024/07/25
Re: [PATCH v2 00/23] Convert avocado tests to normal Python unittests, Philippe Mathieu-Daudé, 2024/07/29