mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 06:18:07 +00:00
feat(tests): allow for removing missing tests when updating UI fixtures from CI
[no changelog]
This commit is contained in:
parent
e21dd94dd5
commit
8e48f354ab
@ -51,10 +51,12 @@ def _get_current_git_branch() -> str:
|
|||||||
help="Not take these jobs",
|
help="Not take these jobs",
|
||||||
multiple=True,
|
multiple=True,
|
||||||
)
|
)
|
||||||
|
@click.option("-r", "--remove-missing", is_flag=True, help="Remove missing tests")
|
||||||
def ci(
|
def ci(
|
||||||
branch: str | None,
|
branch: str | None,
|
||||||
only_jobs: Iterable[str] | None,
|
only_jobs: Iterable[str] | None,
|
||||||
exclude_jobs: Iterable[str] | None,
|
exclude_jobs: Iterable[str] | None,
|
||||||
|
remove_missing: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Update fixtures file with results from CI."""
|
"""Update fixtures file with results from CI."""
|
||||||
print("Updating from CI...")
|
print("Updating from CI...")
|
||||||
@ -89,6 +91,15 @@ def ci(
|
|||||||
current_model = current_fixtures.setdefault(model, {})
|
current_model = current_fixtures.setdefault(model, {})
|
||||||
current_group = current_model.setdefault(group, {}) # type: ignore
|
current_group = current_model.setdefault(group, {}) # type: ignore
|
||||||
|
|
||||||
|
if remove_missing:
|
||||||
|
# get rid of tests that were not run in CI
|
||||||
|
removed = 0
|
||||||
|
for key in list(current_group.keys()):
|
||||||
|
if key not in ui_res_dict[model][group]:
|
||||||
|
current_group.pop(key)
|
||||||
|
removed += 1
|
||||||
|
print(f"Removed {removed} tests.")
|
||||||
|
|
||||||
differing = 0
|
differing = 0
|
||||||
for test_name, res in ui_res_dict[model][group].items():
|
for test_name, res in ui_res_dict[model][group].items():
|
||||||
if current_group.get(test_name) != res:
|
if current_group.get(test_name) != res:
|
||||||
|
Loading…
Reference in New Issue
Block a user