mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 12:28:09 +00:00
feat(tests): show newly created tests in master-diff report
[no changelog]
This commit is contained in:
parent
618bf43743
commit
e21dd94dd5
@ -205,10 +205,12 @@ def _get_unique_differing_screens(
|
|||||||
master_screens_path = MASTER_CACHE_DIR / master_hash
|
master_screens_path = MASTER_CACHE_DIR / master_hash
|
||||||
if not master_screens_path.exists():
|
if not master_screens_path.exists():
|
||||||
master_screens_path.mkdir()
|
master_screens_path.mkdir()
|
||||||
try:
|
# master_hash may be empty, in case of new test
|
||||||
download.fetch_recorded(master_hash, master_screens_path)
|
if master_hash:
|
||||||
except RuntimeError as e:
|
try:
|
||||||
print("WARNING:", e)
|
download.fetch_recorded(master_hash, master_screens_path)
|
||||||
|
except RuntimeError as e:
|
||||||
|
print("WARNING:", e)
|
||||||
|
|
||||||
current_screens_path = get_screen_path(test_name)
|
current_screens_path = get_screen_path(test_name)
|
||||||
if not current_screens_path:
|
if not current_screens_path:
|
||||||
@ -217,7 +219,10 @@ def _get_unique_differing_screens(
|
|||||||
|
|
||||||
# Saving all the images to a common directory
|
# Saving all the images to a common directory
|
||||||
# They will be referenced from the HTML files
|
# They will be referenced from the HTML files
|
||||||
master_screens, master_hashes = screens_and_hashes(master_screens_path)
|
if master_hash:
|
||||||
|
master_screens, master_hashes = screens_and_hashes(master_screens_path)
|
||||||
|
else:
|
||||||
|
master_screens, master_hashes = [], []
|
||||||
current_screens, current_hashes = screens_and_hashes(current_screens_path)
|
current_screens, current_hashes = screens_and_hashes(current_screens_path)
|
||||||
html.store_images(master_screens, master_hashes)
|
html.store_images(master_screens, master_hashes)
|
||||||
html.store_images(current_screens, current_hashes)
|
html.store_images(current_screens, current_hashes)
|
||||||
|
@ -270,7 +270,10 @@ def _get_current_results() -> FixturesType:
|
|||||||
def master_diff() -> None:
|
def master_diff() -> None:
|
||||||
"""Creating an HTML page showing all screens differing from master."""
|
"""Creating an HTML page showing all screens differing from master."""
|
||||||
current = _get_current_results()
|
current = _get_current_results()
|
||||||
_removed_tests, _added_tests, diff_tests = get_diff(current)
|
_removed_tests, added_tests, diff_tests = get_diff(current)
|
||||||
|
# Enriching the diff tests with the newly added ones (empty master hash)
|
||||||
|
for key, value in added_tests.items():
|
||||||
|
diff_tests[key] = ("", value)
|
||||||
generate_master_diff_report(diff_tests, TESTREPORT_PATH)
|
generate_master_diff_report(diff_tests, TESTREPORT_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user