Skip to content

Commit

Permalink
tests: mock whattrainisitnow responses (#1606)
Browse files Browse the repository at this point in the history
The actual response for 134 lost its pre-release milestones when it hit
release, making the test fail.
  • Loading branch information
jcristau authored Jan 9, 2025
1 parent 1160496 commit 8f0df87
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions api/tests/test_product_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,62 @@ async def test_rebuild(app, tmp_path):
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_DIR", tmp_path / "product-details"),
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_NEW_DIR", tmp_path / "product-details-new"),
mock.patch("shipit_api.common.config.PRODUCT_DETAILS_CACHE_DIR", tmp_path / "product-details-cache"),
aioresponses(passthrough=["https://hg.mozilla.org"]) as m,
):
m.get(
"https://whattrainisitnow.com/api/release/schedule/?version=135",
repeat=True,
payload={
"version": "135.0",
"nightly_start": "2024-11-25 00:00:00+00:00",
"a11y_request_deadline": "2024-11-29 00:00:00+00:00",
"qa_request_deadline": "2024-11-29 00:00:00+00:00",
"qa_feature_done_1": "2024-12-06 21:00:00+00:00",
"qa_feature_done_2": "2025-01-02 08:00:00+00:00",
"soft_code_freeze": "2025-01-02 08:00:00+00:00",
"qa_test_plan_due": "2025-01-03 00:00:00+00:00",
"string_freeze": "2025-01-03 00:00:00+00:00",
"qa_pre_merge_done": "2025-01-03 14:00:00+00:00",
"merge_day": "2025-01-06 00:00:00+00:00",
"beta_1": "2025-01-06 00:00:00+00:00",
"beta_2": "2025-01-08 13:00:00+00:00",
"beta_3": "2025-01-10 13:00:00+00:00",
"sumo_1": "2025-01-10 21:00:00+00:00",
"beta_4": "2025-01-13 13:00:00+00:00",
"beta_5": "2025-01-15 13:00:00+00:00",
"beta_6": "2025-01-17 13:00:00+00:00",
"beta_7": "2025-01-20 13:00:00+00:00",
"sumo_2": "2025-01-20 21:00:00+00:00",
"beta_8": "2025-01-22 13:00:00+00:00",
"qa_pre_rc_signoff": "2025-01-22 14:00:00+00:00",
"beta_9": "2025-01-24 13:00:00+00:00",
"rc_gtb": "2025-01-27 21:00:00+00:00",
"rc": "2025-01-28 00:00:00+00:00",
"release": "2025-02-04 14:00:00+00:00",
"mobile_dot_release": "2025-02-11 00:00:00+00:00",
"planned_dot_release": "2025-02-18 00:00:00+00:00",
},
)
m.get(
"https://whattrainisitnow.com/api/release/schedule/?version=134",
repeat=True,
payload={
"version": "134.0",
"nightly_start": "2024-10-29 00:00:00+00:00",
"soft_code_freeze": "2024-11-21 08:00:00+00:00",
"merge_day": "2024-11-25 00:00:00+00:00",
"beta_1": "2024-11-26 00:00:00+00:00",
"beta_2": "2024-11-27 00:00:00+00:00",
"beta_3": "2024-11-29 00:00:00+00:00",
"beta_4": "2024-12-02 00:00:00+00:00",
"beta_5": "2024-12-04 00:00:00+00:00",
"beta_6": "2024-12-06 00:00:00+00:00",
"beta_7": "2024-12-09 00:00:00+00:00",
"beta_8": "2024-12-11 00:00:00+00:00",
"beta_9": "2024-12-13 00:00:00+00:00",
"release": "2025-01-07 14:00:00+00:00",
},
)
await rebuild(app.db.session, "testing", "https://github.com/mozilla-releng/product-details", "public", 130)

parent = tmp_path / "product-details" / "public" / "1.0"
Expand Down

0 comments on commit 8f0df87

Please sign in to comment.