Skip to content

Commit c79fdc3

Browse files
committed
Merge main
2 parents 3a7cf2b + a7f5d28 commit c79fdc3

File tree

8 files changed

+108
-1
lines changed

8 files changed

+108
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"url": "http://127.0.0.1:8080/whittard_ad.html",
3+
"field_mapping": {
4+
"given_name": "28187127-a9d5-41fc-ad29-422d4386dc6f",
5+
"family_name": "7f521e28-34c7-4b61-9222-b9faa2d4ce95",
6+
"street_address": "5625975f-1ca8-4632-8c66-52c490e87a02",
7+
"address_level_2": "68ae7843-fd19-4c76-b2c4-c0b488f977a2",
8+
"country": "7b1e5bca-1ef1-4e22-82ea-d56c435925fe",
9+
"postal_code": "7d9b7aec-75c2-4314-97a0-483255b0f978",
10+
"telephone": "9db0d3e3-54bf-4544-b190-3aed129d05c9",
11+
"email": "5f649f14-02ea-42a9-9937-c82e1b3a6372"
12+
},
13+
14+
"form_field": "*[data-moz-autofill-inspect-id='{given_name}']",
15+
"fields": [
16+
"28187127-a9d5-41fc-ad29-422d4386dc6f",
17+
"7f521e28-34c7-4b61-9222-b9faa2d4ce95",
18+
"5625975f-1ca8-4632-8c66-52c490e87a02",
19+
"68ae7843-fd19-4c76-b2c4-c0b488f977a2",
20+
"7b1e5bca-1ef1-4e22-82ea-d56c435925fe",
21+
"7d9b7aec-75c2-4314-97a0-483255b0f978",
22+
"9db0d3e3-54bf-4544-b190-3aed129d05c9",
23+
"5f649f14-02ea-42a9-9937-c82e1b3a6372"
24+
]
25+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"url": "http://127.0.0.1:8080/whittard_cc.html",
3+
"field_mapping": {
4+
"card_name": "6e32bfc1-3e4d-4d3b-90c1-a079316bb378",
5+
"card_number": "cf035d07-1eb9-4efe-ad91-2ed125c685be",
6+
"expiration_month": "1c5508ad-3599-410f-9853-1ec898d759d4",
7+
"expiration_year": "a4f54662-6c32-49cb-97ab-2ef2430a4f50",
8+
"cvv": "f4020ed8-6221-4359-ac0a-3dff8bc30282"
9+
},
10+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
11+
"skip": "True",
12+
"fields": [
13+
"6e32bfc1-3e4d-4d3b-90c1-a079316bb378",
14+
"cf035d07-1eb9-4efe-ad91-2ed125c685be",
15+
"1c5508ad-3599-410f-9853-1ec898d759d4",
16+
"a4f54662-6c32-49cb-97ab-2ef2430a4f50",
17+
"f4020ed8-6221-4359-ac0a-3dff8bc30282"
18+
]
19+
}

l10n_CM/region/GB.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"region": "GB",
33
"sites": [
44
"ebay",
5-
"demo"
5+
"demo",
6+
"whittard"
67
],
78
"tests": [
89
]

l10n_CM/run_l10n.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"yellowkorner",
4242
"wish",
4343
"bijoubrigitte",
44+
"whittard",
4445
}
4546

4647
loaded_valid_sites = valid_l10n_mappings().keys()

l10n_CM/sites/whittard/GB/whittard_ad.html

Lines changed: 11 additions & 0 deletions
Large diffs are not rendered by default.

l10n_CM/sites/whittard/GB/whittard_cc.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

modules/testrail.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,18 @@ def create_new_plan_entry(
350350
payload["runs"] = runs
351351
return self.client.send_post(f"/add_plan_entry/{plan_id}", payload)
352352

353+
def update_plan(self, plan_id, **kwargs):
354+
"""Given a plan id, update the plan per kwargs"""
355+
if not kwargs:
356+
return False
357+
return self.client.send_post(f"/update_plan/{plan_id}", kwargs)
358+
359+
def update_plan_entry(self, plan_id, entry_id, **kwargs):
360+
"""Given a plan id and entry id, update the entry per kwargs"""
361+
if not kwargs:
362+
return False
363+
return self.client.send_post(f"/update_plan_entry/{plan_id}/{entry_id}", kwargs)
364+
353365
def matching_configs(self, testrail_project_id, config_group_id, config_name):
354366
"""Given a project id, a config group id, and a config name, return the matching config object"""
355367
configs = self.client.send_get(f"/get_configs/{testrail_project_id}")

modules/testrail_integration.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,37 @@
1919
PLAN_NAME_RE = re.compile(r"\[(\w+) (\d+)\]")
2020
CONFIG_GROUP_ID = 95
2121
TESTRAIL_FX_DESK_PRJ = 17
22+
TC_EXECUTION_TEMPLATE = "https://firefox-ci-tc.services.mozilla.com/tasks/%TASK_ID%/runs/%RUN_ID%/logs/public/logs/live.log"
23+
24+
25+
def get_execution_link() -> str:
26+
"""Using environment variables, get the link to the test execution"""
27+
link = ""
28+
if "TASKCLUSTER_PROXY_URL" in os.environ:
29+
link = TC_EXECUTION_TEMPLATE
30+
for item in ["RUN_ID", "TASK_ID"]:
31+
link = link.replace(f"%{item}%", os.environ.get(item))
32+
return link
33+
34+
35+
def replace_link_in_description(description, os_name) -> str:
36+
"""Add or replace a test execution link in the test run description"""
37+
logging.warning(f"Modifying plan description for %{os_name}%")
38+
if os_name not in description:
39+
# TODO: remove following conditional when links for GHA resolved
40+
if os_name == "Linux":
41+
return f"{description}\n[{os_name} execution link]({get_execution_link()})"
42+
else:
43+
link = get_execution_link()
44+
if link in description:
45+
return description
46+
lines = description.split("\n")
47+
for i, line in enumerate(lines):
48+
if os_name in line:
49+
lines[i] = (
50+
f"{description}\n[{os_name} execution link]({get_execution_link()})"
51+
)
52+
return description
2253

2354

2455
def get_plan_title(version_str: str, channel: str) -> str:
@@ -321,6 +352,12 @@ def organize_l10n_entries(
321352
if len(site_entries) != 1:
322353
logging.info("Suite entries are broken somehow")
323354

355+
# Add execution link to plan description
356+
357+
os_name = config.split(" ")[0]
358+
description = replace_link_in_description(expected_plan["description"], os_name)
359+
testrail_session.update_plan(plan_id, description=description)
360+
324361
# There should only be one entry per site per plan
325362
# Check that this entry has a run with the correct config
326363
# And if not, make that run

0 commit comments

Comments
 (0)