qemu-ppc
[Top][All Lists]
Advanced

[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: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/4] tests/functional: Don't fail the whole test if a pre-cache fetch fails
Date: Fri, 20 Dec 2024 11:33:43 +0100
User-agent: Mozilla Thunderbird

+danpb

On 20/12/24 03:46, 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):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]