Skip to content

Commit cad7b25

Browse files
committed
fix: make test_product_details pass in CI again
AFAICT the passing through of hg.mozilla.org requests ends up causing this to fail in CI a bunch, presumably due to getting rate limited by hg. This also has the added bonus of speeding up local tests.
1 parent c9baebe commit cad7b25

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

api/tests/test_product_details.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ def mock_git_push(branch, secrets):
103103
return
104104

105105

106+
# A representative set of Firefox/Thunderbird locales. The exact contents don't
107+
# matter, but there must be more than the sanity check's minimum (20) so that
108+
# sanity_check_firefox_builds passes, and "ach" must be present (asserted below).
109+
L10N_CHANGESETS = {
110+
locale: {"revision": "abcdef123456", "platforms": ["linux", "linux64", "macosx64", "win32", "win64"], "pin": False}
111+
for locale in (
112+
"ach", "af", "an", "ar", "ast", "az", "be", "bg", "bn", "br",
113+
"bs", "ca", "cak", "cs", "cy", "da", "de", "dsb", "el", "en-CA",
114+
"en-GB", "eo", "es-AR", "es-CL", "es-ES", "es-MX", "et", "eu", "fa", "ff",
115+
)
116+
}
117+
118+
106119
@pytest.mark.asyncio
107120
@mock.patch("shipit_api.admin.product_details.setup_working_copy", mock_setup_working_copy)
108121
@mock.patch("shipit_api.admin.product_details.git_push", mock_git_push)
@@ -149,8 +162,22 @@ async def test_rebuild(app, tmp_path):
149162
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_DIR", tmp_path / "product-details"),
150163
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_NEW_DIR", tmp_path / "product-details-new"),
151164
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_CACHE_DIR", tmp_path / "product-details-cache"),
152-
aioresponses(passthrough=["https://hg.mozilla.org"]) as m,
165+
aioresponses() as m,
153166
):
167+
hg_l10n_urls = [
168+
# devedition 134.0b9
169+
"https://hg.mozilla.org/releases/mozilla-beta/raw-file/615791f9752c70ef1757abf68544c8275f219ce3/browser/locales/l10n-changesets.json",
170+
# firefox beta 134.0b8
171+
"https://hg.mozilla.org/releases/mozilla-beta/raw-file/9fb87e89c26069198ce2a59a0a790a264d225169/browser/locales/l10n-changesets.json",
172+
# firefox release 133.0
173+
"https://hg.mozilla.org/releases/mozilla-release/raw-file/8141aab3ba856d7cbae6c851dd71f2e0cb69649c/browser/locales/l10n-changesets.json",
174+
# firefox nightly 135.0a1
175+
"https://hg.mozilla.org/mozilla-central/raw-file/default/browser/locales/l10n-changesets.json",
176+
# thunderbird nightly 135.0a1
177+
"https://hg.mozilla.org/comm-central/raw-file/default/mail/locales/l10n-changesets.json",
178+
]
179+
for url in hg_l10n_urls:
180+
m.get(url, repeat=True, payload=L10N_CHANGESETS)
154181
m.get(
155182
"https://whattrainisitnow.com/api/release/schedule/?version=135",
156183
repeat=True,

0 commit comments

Comments
 (0)