From a443a4a4308fc86a1744e1387ed6a0ebf1705b0a Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Thu, 27 Aug 2020 20:24:24 +0200 Subject: [PATCH] tests/upgrade: add support for filenames with revision --- tests/emulators.py | 2 +- tests/upgrade_tests/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/emulators.py b/tests/emulators.py index cf07170270..ad503e6be5 100644 --- a/tests/emulators.py +++ b/tests/emulators.py @@ -54,7 +54,7 @@ def get_tags(): result = defaultdict(list) for f in sorted(files): try: - # example: "trezor-emu-core-v2.1.1" + # example: "trezor-emu-core-v2.1.1" or "trezor-emu-core-v2.1.1-46ab42fw" _, _, gen, tag = f.name.split("-", maxsplit=3) result[gen].append(tag) except ValueError: diff --git a/tests/upgrade_tests/__init__.py b/tests/upgrade_tests/__init__.py index 7a2e1a0cbe..eac1d95a56 100644 --- a/tests/upgrade_tests/__init__.py +++ b/tests/upgrade_tests/__init__.py @@ -79,7 +79,10 @@ def for_all(*args, legacy_minimum_version=(1, 0, 0), core_minimum_version=(2, 0, try: for tag in ALL_TAGS[gen]: if tag.startswith("v"): - tag_version = tuple(int(n) for n in tag[1:].split(".")) + tag_version = tag[1:] + if "-" in tag: # contains revision + tag_version = tag[1:-9] + tag_version = tuple(int(n) for n in tag_version.split(".")) if tag_version < minimum_version: continue all_params.append((gen, tag))