mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 17:38:39 +00:00
tests: do not error out when fixtures fail to download
This commit is contained in:
parent
42c4eb6341
commit
d88540f2e0
@ -7,7 +7,8 @@ from itertools import zip_longest
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import dominate
|
import dominate
|
||||||
from dominate.tags import a, div, h1, h2, hr, i, img, p, table, td, th, tr
|
from dominate.tags import a, div, h1, h2, hr, i, img, p, strong, table, td, th, tr
|
||||||
|
from dominate.util import text
|
||||||
|
|
||||||
from . import download
|
from . import download
|
||||||
|
|
||||||
@ -102,19 +103,26 @@ def failed(fixture_test_path, test_name, actual_hash, expected_hash):
|
|||||||
recorded_path = fixture_test_path / "recorded"
|
recorded_path = fixture_test_path / "recorded"
|
||||||
actual_path = fixture_test_path / "actual"
|
actual_path = fixture_test_path / "actual"
|
||||||
|
|
||||||
|
download_failed = False
|
||||||
|
|
||||||
if not recorded_path.exists():
|
if not recorded_path.exists():
|
||||||
recorded_path.mkdir()
|
recorded_path.mkdir()
|
||||||
download.fetch_recorded(expected_hash, recorded_path)
|
try:
|
||||||
|
download.fetch_recorded(expected_hash, recorded_path)
|
||||||
|
except Exception:
|
||||||
|
download_failed = True
|
||||||
|
|
||||||
recorded_screens = sorted(recorded_path.iterdir())
|
recorded_screens = sorted(recorded_path.iterdir())
|
||||||
actual_screens = sorted(actual_path.iterdir())
|
actual_screens = sorted(actual_path.iterdir())
|
||||||
|
|
||||||
if not recorded_screens:
|
|
||||||
return
|
|
||||||
|
|
||||||
with doc:
|
with doc:
|
||||||
_header(test_name, expected_hash, actual_hash)
|
_header(test_name, expected_hash, actual_hash)
|
||||||
|
|
||||||
|
if download_failed:
|
||||||
|
with p():
|
||||||
|
strong("WARNING:")
|
||||||
|
text(" failed to download recorded fixtures. Is this a new test case?")
|
||||||
|
|
||||||
with table(border=1, width=600):
|
with table(border=1, width=600):
|
||||||
with tr():
|
with tr():
|
||||||
th("Expected")
|
th("Expected")
|
||||||
|
Loading…
Reference in New Issue
Block a user