On Fri, Jul 26, 2024 at 9:04 AM Thomas Huth <th...@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.


Reply via email to