Skip to content

Commit d92e2c7

Browse files
Merge pull request #656 from mozilla/philimon/l10n_workflow_fix
Philimon/Fix_l10n_workflow
2 parents 4e78ed8 + 8fefc08 commit d92e2c7

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

.github/workflows/l10n.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ jobs:
138138
uses: actions/setup-python@v5
139139
with:
140140
python-version: "3.11"
141+
- name: Set Environment (Scheduled Beta)
142+
if: ${{ inputs.job_to_run == 'L10N-Linux' }}
143+
run: |
144+
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
145+
echo "Running report for most recent Beta on Linux";
141146
- name: Install dependencies
142147
id: setup
143148
env:
144149
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
145150
run: |
146-
echo "MANUAL='true'" >> "$GITHUB_ENV";
147151
echo "Running l10n tests on supplied executable";
148152
sudo apt install gnome-screenshot;
149153
uname -m;
@@ -225,7 +229,7 @@ jobs:
225229
New-item -Name .env -Value $env_contents -ItemType File -Force
226230
Write-Host "Running l10n tests on supplied executable"
227231
- name: Set Environment (Scheduled Beta)
228-
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
232+
if: ${{ inputs.job_to_run == 'L10N-Windows' }}
229233
run: |
230234
$env_contents = @"
231235
TESTRAIL_REPORT='true'

l10n_CM/run_l10n.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"bestbuy",
2525
"decathlon",
2626
"vans",
27-
"ebay"
27+
"ebay",
2828
}
2929
live_sites = []
3030

modules/testrail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def update_test_cases(
391391
testrail_suite_id,
392392
test_case_ids=[],
393393
status="passed",
394-
elapsed=[]
394+
elapsed=[],
395395
):
396396
"""Given a project id, a run id, and a suite id, for each case given a status,
397397
update the test objects with the correct status code"""
@@ -409,14 +409,14 @@ def update_test_cases(
409409
testrail_project_id, testrail_suite_id
410410
)
411411
]
412-
412+
413413
results = []
414414
for i in range(len(test_case_ids)):
415415
results.append(
416416
{
417417
"case_id": test_case_ids[i],
418418
"status_id": status_key.get(status),
419-
"elapsed": elapsed[i]
419+
"elapsed": elapsed[i],
420420
}
421421
)
422422
logging.warning(f"Going to update cases with payload: {results}")

modules/testrail_integration.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def mark_results(testrail_session: TestRail, test_results):
262262
durations.append(all_durations[i])
263263
logging.warning(
264264
f"Setting the following test cases in run {run_id} to {category}: {test_cases_ids}"
265-
)
265+
)
266266
logging.warning(
267267
f"Setting the following test cases {test_cases_ids} to duration {durations}"
268268
)
@@ -272,7 +272,7 @@ def mark_results(testrail_session: TestRail, test_results):
272272
testrail_suite_id=suite_id,
273273
test_case_ids=test_cases_ids,
274274
status=category,
275-
elapsed=durations
275+
elapsed=durations,
276276
)
277277

278278

@@ -562,7 +562,9 @@ def collect_changes(testrail_session: TestRail, report):
562562

563563
version_str = metadata.get("fx_version")
564564
plan_title = get_plan_title(version_str, channel)
565-
logging.warning(f"Got plan title: {plan_title} from version {version_str} and channel {channel}")
565+
logging.warning(
566+
f"Got plan title: {plan_title} from version {version_str} and channel {channel}"
567+
)
566568
plan_match = PLAN_NAME_RE.match(plan_title)
567569
(_, major) = [plan_match[n] for n in range(1, 3)]
568570
config = metadata.get("machine_config")
@@ -671,15 +673,21 @@ def collect_changes(testrail_session: TestRail, report):
671673
# Tests reported as rerun are a problem -- we need to know pass/fail
672674
if outcome == "rerun":
673675
outcome = test.get("call").get("outcome")
674-
duration = test['setup']['duration'] + test['call']['duration'] + test['teardown']['duration']
676+
duration = (
677+
test["setup"]["duration"]
678+
+ test["call"]["duration"]
679+
+ test["teardown"]["duration"]
680+
)
675681
logging.info(f"TC: {test_case}: {outcome} using {duration}s ")
676682

677683
if not results_by_suite.get(suite_id):
678684
results_by_suite[suite_id] = {}
679685
durations_by_suite[suite_id] = {}
680686
results_by_suite[suite_id][test_case] = outcome
681687
durations_by_suite[suite_id].setdefault(test_case, 0)
682-
durations_by_suite[suite_id][test_case] = round(durations_by_suite[suite_id][test_case] + duration, 2)
688+
durations_by_suite[suite_id][test_case] = round(
689+
durations_by_suite[suite_id][test_case] + duration, 2
690+
)
683691

684692
if suite_id != last_suite_id:
685693
# When we get the last test_case in a suite, add entry, run, results
@@ -695,7 +703,7 @@ def collect_changes(testrail_session: TestRail, report):
695703
"config_id": config_id,
696704
"cases": cases_in_suite,
697705
"results": results_by_suite[last_suite_id],
698-
"durations": durations_by_suite[last_suite_id]
706+
"durations": durations_by_suite[last_suite_id],
699707
}
700708

701709
full_test_results = merge_results(
@@ -716,7 +724,7 @@ def collect_changes(testrail_session: TestRail, report):
716724
"config_id": config_id,
717725
"cases": cases_in_suite,
718726
"results": results_by_suite[last_suite_id],
719-
"durations": durations_by_suite[last_suite_id]
727+
"durations": durations_by_suite[last_suite_id],
720728
}
721729

722730
logging.info(f"n run {last_suite_id}, {last_description}")

0 commit comments

Comments
 (0)