From 1b7b06255ab2ebb5182bb292ea644feb776f0828 Mon Sep 17 00:00:00 2001 From: matejcik Date: Mon, 21 Jun 2021 13:55:26 +0200 Subject: [PATCH] feat(tests): only try connecting to VPN once --- tests/ui_tests/reporting/download.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ui_tests/reporting/download.py b/tests/ui_tests/reporting/download.py index d8f92da23..dbf0977ef 100644 --- a/tests/ui_tests/reporting/download.py +++ b/tests/ui_tests/reporting/download.py @@ -11,8 +11,15 @@ RECORDS_WEBSITE = "https://firmware.corp.sldev.cz/ui_tests/" FIXTURES_MASTER = "https://raw.githubusercontent.com/trezor/trezor-firmware/master/tests/ui_tests/fixtures.json" FIXTURES_CURRENT = pathlib.Path(__file__).parent / "../fixtures.json" +_dns_failed = False + def fetch_recorded(hash, path): + global _dns_failed + + if _dns_failed: + raise RuntimeError("Not trying firmware.corp.sldev.cz again after DNS failure.") + zip_src = RECORDS_WEBSITE + hash + ".zip" zip_dest = path / "recorded.zip" @@ -21,6 +28,7 @@ def fetch_recorded(hash, path): except urllib.error.HTTPError: raise RuntimeError("No such recorded collection was found on '%s'." % zip_src) except urllib.error.URLError: + _dns_failed = True raise RuntimeError( "Server firmware.corp.sldev.cz could not be found. Are you on VPN?" )