2019-12-30 13:09:18 +00:00
|
|
|
import shutil
|
2021-09-02 11:04:16 +00:00
|
|
|
import sys
|
2019-12-30 13:09:18 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2022-01-28 15:02:17 +00:00
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
2021-09-02 11:04:16 +00:00
|
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
# Needed for setup purposes, filling the FILE_HASHES dict
|
2023-06-27 12:36:11 +00:00
|
|
|
from tests.ui_tests.common import TestResult, _hash_files # isort:skip
|
|
|
|
from tests.ui_tests.common import get_current_fixtures # isort:skip
|
2019-12-30 13:09:18 +00:00
|
|
|
|
|
|
|
|
2023-06-27 12:36:11 +00:00
|
|
|
FIXTURES = get_current_fixtures()
|
2019-12-30 13:09:18 +00:00
|
|
|
|
2023-02-03 15:00:15 +00:00
|
|
|
for result in TestResult.recent_results():
|
2023-01-27 14:13:12 +00:00
|
|
|
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
|
2020-01-06 14:44:30 +00:00
|
|
|
assert expected_hash == actual_hash
|
2022-01-28 15:02:17 +00:00
|
|
|
shutil.make_archive(
|
2023-01-27 14:13:12 +00:00
|
|
|
str(ROOT / "ci/ui_test_records" / actual_hash), "zip", result.test.actual_dir
|
2022-01-28 15:02:17 +00:00
|
|
|
)
|