[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] tests/functional: Don't fail the whole test if a pre-cac
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH 1/4] tests/functional: Don't fail the whole test if a pre-cache fetch fails |
Date: |
Fri, 20 Dec 2024 10:38:56 +0000 |
User-agent: |
Mutt/2.2.13 (2024-03-09) |
On Fri, Dec 20, 2024 at 12:46:14PM +1000, Nicholas Piggin wrote:
> If any pre-cache downloads fail, the entire functional test run
> is failed.
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> tests/functional/qemu_test/asset.py | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tests/functional/qemu_test/asset.py
> b/tests/functional/qemu_test/asset.py
> index f126cd5863a..f82b07e7027 100644
> --- a/tests/functional/qemu_test/asset.py
> +++ b/tests/functional/qemu_test/asset.py
> @@ -102,7 +102,8 @@ def fetch(self):
> return str(self.cache_file)
>
> if os.environ.get("QEMU_TEST_NO_DOWNLOAD", False):
> - raise Exception("Asset cache is invalid and downloads disabled")
> + raise Exception("Failed to fetch asset %s, not found in cache "
> + "and downloads are disabled", self.url)
>
> self.log.info("Downloading %s to %s...", self.url, self.cache_file)
> tmp_cache_file = self.cache_file.with_suffix(".download")
> @@ -162,7 +163,13 @@ def precache_test(test):
> for name, asset in vars(test.__class__).items():
> if name.startswith("ASSET_") and type(asset) == Asset:
> log.info("Attempting to cache '%s'" % asset)
> - asset.fetch()
> + try:
> + asset.fetch()
> + except:
> + # Asset pre-cache should not be fatal. An error is
> printed
> + # and the test itself will fail if it is unable to get
> the
> + # assert.
> + pass
> log.removeHandler(handler)
>
> def precache_suite(suite):
Asset fetching errors & skipping tests is being handled by a pending
pull request:
https://lists.nongnu.org/archive/html/qemu-devel/2024-12/msg04334.html
https://lists.nongnu.org/archive/html/qemu-devel/2024-12/msg04333.html
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 :|