From 924f05c3277bbec30adc94d00b2aba2affd519cd Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Wed, 26 Jun 2024 12:13:26 +0200 Subject: [PATCH] Fix remote tests (#692) * Stabilize remote tests for potential connection errors * Fix broken tests and remove those that don't longer work --- tests/remote/test_devedition.py | 2 ++ tests/remote/test_fenix.py | 2 ++ tests/remote/test_firefox.py | 11 +++++------ tests/remote/test_thunderbird.py | 22 ++++++++++++++-------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/tests/remote/test_devedition.py b/tests/remote/test_devedition.py index ff69f9b2..6eba1e5a 100644 --- a/tests/remote/test_devedition.py +++ b/tests/remote/test_devedition.py @@ -31,6 +31,7 @@ ]) def test_release_scraper(tmpdir, args, url): """Test release scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseScraper(destination=tmpdir, **args) if url: @@ -56,6 +57,7 @@ def test_release_scraper(tmpdir, args, url): ]) def test_candidate_scraper(tmpdir, args, url): """Test release candidate scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseCandidateScraper(destination=tmpdir, **args) assert unquote(scraper.url) == urljoin(BASE_URL, url) diff --git a/tests/remote/test_fenix.py b/tests/remote/test_fenix.py index 213a55b4..6d8aa10a 100644 --- a/tests/remote/test_fenix.py +++ b/tests/remote/test_fenix.py @@ -56,6 +56,7 @@ ]) def test_release_scraper(tmpdir, args, url): """Test release scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseScraper(destination=tmpdir, **args) if url: @@ -80,4 +81,5 @@ def test_release_scraper(tmpdir, args, url): 'extension': 'apk'}, ]) def test_daily_scraper(tmpdir, args): + args.update({"retry_attempts": 5, "retry_delay": 0.1}) mozdownload.DailyScraper(destination=tmpdir, **args) diff --git a/tests/remote/test_firefox.py b/tests/remote/test_firefox.py index 2b2a0a04..7286ffaa 100644 --- a/tests/remote/test_firefox.py +++ b/tests/remote/test_firefox.py @@ -39,6 +39,7 @@ ]) def test_release_scraper(tmpdir, args, url): """Test release scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseScraper(destination=tmpdir, **args) if url: @@ -70,6 +71,7 @@ def test_release_scraper(tmpdir, args, url): ]) def test_candidate_scraper(tmpdir, args, url): """Test release candidate scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseCandidateScraper(destination=tmpdir, **args) assert unquote(scraper.url) == urljoin(BASE_URL, url) @@ -86,7 +88,7 @@ def test_candidate_scraper(tmpdir, args, url): {'branch': 'mozilla-central', 'platform': 'win32', 'date': '2015-10-21'}, {'branch': 'mozilla-central', 'platform': 'win32', 'date': '2015-10-21', 'build_number': 2}, {'branch': 'mozilla-central', 'platform': 'win32', 'build_id': '20151021065025'}, - {'branch': 'mozilla-central', 'platform': 'win32', 'build_id': '20151021030212', + {'branch': 'mozilla-central', 'platform': 'linux', 'build_id': '20240106211805', 'locale': 'de'}, {'branch': 'mozilla-central', 'platform': 'win32', 'build_id': '20151021030212', 'extension': 'txt'}, @@ -99,22 +101,19 @@ def test_candidate_scraper(tmpdir, args, url): ]) def test_daily_scraper(tmpdir, args): """Test daily scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) mozdownload.DailyScraper(destination=tmpdir, **args) @pytest.mark.ci_only @pytest.mark.parametrize("args", [ - {'branch': 'mozilla-release', 'platform': 'linux'}, - {'branch': 'mozilla-release', 'platform': 'linux64'}, - {'branch': 'mozilla-release', 'platform': 'mac'}, - {'branch': 'mozilla-release', 'platform': 'win32'}, - {'branch': 'mozilla-release', 'platform': 'win64'}, {'branch': 'mozilla-central', 'platform': 'win32', 'debug_build': True}, {'branch': 'mozilla-central', 'platform': 'win32', 'locale': 'de'}, {'branch': 'mozilla-central', 'platform': 'win32', 'extension': 'txt'}, ]) def test_tinderbox_scraper(tmpdir, args): """Test tinderbox scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) mozdownload.TinderboxScraper(destination=tmpdir, **args) diff --git a/tests/remote/test_thunderbird.py b/tests/remote/test_thunderbird.py index f96cab99..8b427101 100644 --- a/tests/remote/test_thunderbird.py +++ b/tests/remote/test_thunderbird.py @@ -29,6 +29,7 @@ ]) def test_release_scraper(tmpdir, args, url): """Test release scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseScraper(destination=tmpdir, **args) if url: @@ -54,6 +55,7 @@ def test_release_scraper(tmpdir, args, url): ]) def test_candidate_scraper(tmpdir, args, url): """Test release candidate scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) scraper = mozdownload.ReleaseCandidateScraper(destination=tmpdir, **args) assert unquote(scraper.url) == urljoin(BASE_URL, url) @@ -66,17 +68,20 @@ def test_candidate_scraper(tmpdir, args, url): {'application': 'thunderbird', 'platform': 'mac', 'branch': 'comm-central'}, {'application': 'thunderbird', 'platform': 'win32', 'branch': 'comm-central'}, {'application': 'thunderbird', 'platform': 'win64', 'branch': 'comm-central'}, - {'application': 'thunderbird', 'platform': 'win64', 'branch': 'comm-central', 'date': '2018-03-01'}, - {'application': 'thunderbird', 'platform': 'win64', 'branch': 'comm-central', 'date': '2018-03-01', - 'build_number': 1}, - {'application': 'thunderbird', 'platform': 'win64', 'branch': 'comm-central', 'build_id': '20180301030201'}, - {'application': 'thunderbird', 'platform': 'linux', 'branch': 'comm-central', 'build_id': '20180301030201', - 'extension': 'txt'}, - {'application': 'thunderbird', 'platform': 'linux', 'branch': 'comm-central', 'build_id': '20180301030201', - 'locale': 'de'}, + {'application': 'thunderbird', 'platform': 'win64', + 'branch': 'comm-central', 'date': '2024-01-02'}, + {'application': 'thunderbird', 'platform': 'win64', + 'branch': 'comm-central', 'date': '2024-01-02', 'build_number': 1}, + {'application': 'thunderbird', 'platform': 'win64', + 'branch': 'comm-central', 'build_id': '20240102101857'}, + {'application': 'thunderbird', 'platform': 'linux', + 'branch': 'comm-central', 'build_id': '20240102101857', 'extension': 'txt'}, + {'application': 'thunderbird', 'platform': 'linux64', + 'branch': 'comm-central', 'build_id': '20240103103152', 'locale': 'de'}, ]) def test_daily_scraper(tmpdir, args): """Test daily scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) mozdownload.DailyScraper(destination=tmpdir, **args) @@ -96,6 +101,7 @@ def test_daily_scraper(tmpdir, args): @pytest.mark.xfail(strict=True, reason="tinderbox builds not available in the archive") def test_tinderbox_scraper(tmpdir, args): """Test tinderbox scraper against the remote server.""" + args.update({"retry_attempts": 5, "retry_delay": 0.1}) mozdownload.TinderboxScraper(destination=tmpdir, **args)