All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH 1/3] tests/functional: enable force refresh of cached assets
Date: Fri, 29 Aug 2025 10:04:15 +0100	[thread overview]
Message-ID: <aLFtD8B9yIWapvCs@redhat.com> (raw)
In-Reply-To: <5f7a13e8-3971-442d-88ac-641460d289da@redhat.com>

On Fri, Aug 29, 2025 at 10:50:41AM +0200, Thomas Huth wrote:
> On 29/08/2025 10.31, Daniel P. Berrangé wrote:
> > If the 'QEMU_TEST_REFRESH_CACHE' environment variable is set, then
> > ignore any existing cached asset and download a fresh copy.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   docs/devel/testing/functional.rst   | 3 +++
> >   tests/functional/qemu_test/asset.py | 4 ++++
> >   2 files changed, 7 insertions(+)
> > 
> > diff --git a/docs/devel/testing/functional.rst b/docs/devel/testing/functional.rst
> > index 3728bab6c0..fdeaebaadc 100644
> > --- a/docs/devel/testing/functional.rst
> > +++ b/docs/devel/testing/functional.rst
> > @@ -312,6 +312,9 @@ The cache is populated in the ``~/.cache/qemu/download`` directory by
> >   default, but the location can be changed by setting the
> >   ``QEMU_TEST_CACHE_DIR`` environment variable.
> > +To force the test suite to re-download the cache, even if still valid,
> > +set the ``QEMU_TEST_REFRESH_CACHE`` environment variable.
> > +
> >   Skipping tests
> >   --------------
> > diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
> > index 704b84d0ea..b5a6136d36 100644
> > --- a/tests/functional/qemu_test/asset.py
> > +++ b/tests/functional/qemu_test/asset.py
> > @@ -72,6 +72,10 @@ def _check(self, cache_file):
> >           return self.hash == hl.hexdigest()
> >       def valid(self):
> > +        if os.getenv("QEMU_TEST_REFRESH_CACHE", None) is not None:
> > +            self.log.info("Force refresh of asset %s", self.url)
> > +            return False
> > +
> 
> Do we really need this? You can also simply "rm ~/.cache/qemu/downloads"
> instead, or click on the "Clear runner caches" in the gitlab CI.

This can selectively refresh assets from a single test

  QEMU_TEST_REFRESH_CACHE=1 ./tests/functional/test_blah.py


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 :|



  reply	other threads:[~2025-08-30 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29  8:31 [PATCH 0/3] tests/functional: improve handling flaky downloads Daniel P. Berrangé
2025-08-29  8:31 ` [PATCH 1/3] tests/functional: enable force refresh of cached assets Daniel P. Berrangé
2025-08-29  8:50   ` Thomas Huth
2025-08-29  9:04     ` Daniel P. Berrangé [this message]
2025-08-29  9:21       ` Thomas Huth
2025-08-29  8:31 ` [PATCH 2/3] tests/functional: fix formatting of exception args Daniel P. Berrangé
2025-08-29  8:52   ` Thomas Huth
2025-08-29  8:31 ` [PATCH 3/3] tests/functional: handle URLError when fetching assets Daniel P. Berrangé
2025-08-29  9:00   ` Thomas Huth
2025-08-29  9:08     ` Daniel P. Berrangé

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=aLFtD8B9yIWapvCs@redhat.com \
    --to=berrange@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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.