mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-21 05:48:23 +00:00
eb195d038b
[no changelog]
29 lines
902 B
Python
29 lines
902 B
Python
import shutil
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
|
sys.path.insert(0, str(ROOT))
|
|
# Needed for setup purposes, filling the FILE_HASHES dict
|
|
from tests.ui_tests.common import TestResult, _hash_files, get_fixtures # isort:skip
|
|
|
|
|
|
FIXTURES = get_fixtures()
|
|
|
|
for result in TestResult.recent_results():
|
|
if not result.passed or result.expected_hash != result.actual_hash:
|
|
print("WARNING: skipping failed test", result.test.id)
|
|
continue
|
|
|
|
actual_hash = _hash_files(result.test.actual_dir)
|
|
expected_hash = (
|
|
FIXTURES.get(result.test.model, {})
|
|
.get(result.test.group, {})
|
|
.get(result.test.fixtures_name)
|
|
)
|
|
assert result.expected_hash == actual_hash
|
|
assert expected_hash == actual_hash
|
|
shutil.make_archive(
|
|
str(ROOT / "ci/ui_test_records" / actual_hash), "zip", result.test.actual_dir
|
|
)
|