Skip to content

Commit de49584

Browse files
Merge branch 'main' into vs/CM-Ebay-FR-DE
2 parents ed51b89 + ded2c12 commit de49584

File tree

89 files changed

+8412
-2508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8412
-2508
lines changed

.github/workflows/check-beta.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check new beta version
22

33
on:
44
schedule:
5-
- cron: "34 */1 * * *"
5+
- cron: "40 */1 * * *"
66
env:
77
LATEST: ""
88
permissions:
@@ -14,6 +14,7 @@ jobs:
1414
outputs:
1515
win_reportable: ${{ steps.reportable.outputs.win }}
1616
mac_reportable: ${{ steps.reportable.outputs.mac }}
17+
mac_l10n_reportable: ${{ steps.reportable.outputs.mac_l10n }}
1718
steps:
1819
- name: Checkout repository
1920
uses: actions/checkout@v4
@@ -29,6 +30,16 @@ jobs:
2930
pipenv install
3031
echo win=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Windows"))') >> "$GITHUB_OUTPUT"
3132
echo mac=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
33+
- name: Check if the l10n run is reportable
34+
id: l10n-reportable
35+
env:
36+
TESTRAIL_REPORT: true
37+
FX_L10N: true
38+
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
39+
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
40+
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
41+
run: echo mac_l10n=$(pipenv run python -c 'from modules import testrail_integration as tri; print(tri.reportable("Darwin"))') >> "$GITHUB_OUTPUT"
42+
3243
Run-Win-Smoke:
3344
needs: Check-Beta-Version
3445
if: ${{ needs.Check-Beta-Version.outputs.win_reportable == 'True' }}
@@ -44,3 +55,11 @@ jobs:
4455
with:
4556
job_to_run: Smoke-MacOS
4657
secrets: inherit
58+
59+
Run-L10N-Mac-Smoke:
60+
needs: Check-Beta-Version
61+
if: ${{ needs.Check-Beta-Version.outputs.mac_l10n_reportable == 'True' }}
62+
uses: ./.github/workflows/l10n.yml
63+
with:
64+
job_to_run: L10N-MacOS
65+
secrets: inherit

.github/workflows/l10n.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
name: L10N Test Execution
3+
4+
run-name: ${{ github.actor }} is running l10n tests
5+
on:
6+
workflow_call:
7+
inputs:
8+
channel:
9+
description: "Channel to run tests against"
10+
default: "beta"
11+
type: string
12+
required: false
13+
job_to_run:
14+
required: true
15+
type: string
16+
workflow_dispatch:
17+
inputs:
18+
mac_installer_link:
19+
description: 'The link to the macOS installer for the Fx under test'
20+
required: false
21+
type: string
22+
env:
23+
FX_CHANNEL: ${{ inputs.channel }}
24+
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
25+
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}
26+
TESTRAIL_USERNAME: ${{ secrets.TESTRAIL_USERNAME }}
27+
SVC_ACCT_DECRYPT: ${{ secrets.SVC_ACCT_DECRYPT }}
28+
FX_L10N: 'true'
29+
30+
jobs:
31+
L10N-MacOS:
32+
if: ${{ inputs.job_to_run == 'L10N-MacOS' || inputs.mac_installer_link }}
33+
runs-on: macos-latest
34+
steps:
35+
- name: Create app token
36+
uses: actions/create-github-app-token@v1
37+
id: app-token
38+
with:
39+
app-id: ${{ secrets.BOT_CLIENT_ID }}
40+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
with:
44+
token: ${{ steps.app-token.outputs.token }}
45+
- name: Set up Python 3.11
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.11"
49+
- name: Check test case numbers
50+
run: |
51+
python check_test_cases.py
52+
exit $?
53+
echo "Triggered by event: ${{ github.event_name }}"
54+
- name: Set Environment (Scheduled Beta)
55+
if: ${{ inputs.job_to_run == 'L10N-MacOS' }}
56+
run: |
57+
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
58+
echo "Running report for most recent Beta on MacOS";
59+
- name: Set Environment (Manual)
60+
if: ${{ inputs.mac_installer_link }}
61+
run: |
62+
echo "MANUAL='true'" >> "$GITHUB_ENV";
63+
echo "Running l10n tests on supplied executable";
64+
- name: Install dependencies
65+
run: |
66+
mkdir -p artifacts/;
67+
pip3 install 'pipenv==2023.11.15';
68+
pip3 install 'ruff>=0.4.8,<0.5';
69+
rm ./pyproject.toml;
70+
mv ./ci_pyproject.toml ./pyproject.toml;
71+
pipenv install
72+
- name: Install Fx
73+
id: setup
74+
env:
75+
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
76+
run:
77+
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
78+
- name: Run L10N Tests in MacOS
79+
if: steps.setup.conclusion == 'success'
80+
env:
81+
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
82+
run: |
83+
"$FX_EXECUTABLE" --version
84+
echo "0" > TEST_EXIT_CODE
85+
pipenv run python check_l10n_test_cases.py
86+
while IFS= read -r line; do
87+
echo "Running tests for: $line"
88+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
89+
done < selected_l10n_mappings
90+
mv artifacts artifacts-mac || true
91+
EXIT_CODE=$(cat TEST_EXIT_CODE)
92+
if [ $EXIT_CODE != 0 ]; then
93+
exit $EXIT_CODE
94+
fi
95+
exit $SCRIPT_EXIT_CODE
96+
- name: Run L10N Tests in MacOS (Headed)
97+
if: steps.setup.conclusion == 'success' && always()
98+
env:
99+
FX_EXECUTABLE: /Volumes/${{ steps.setup.outputs.app_name }}/${{ steps.setup.outputs.app_name }}.app/Contents/MacOS/firefox
100+
REPORTABLE: ${{ env.TESTRAIL_REPORT == 'true' }}
101+
run: |
102+
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
103+
echo "0" > TEST_EXIT_CODE
104+
pipenv run python check_l10n_test_cases.py
105+
while IFS= read -r line; do
106+
echo "Running tests for: $line"
107+
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
108+
done < selected_l10n_mappings
109+
mv -n artifacts/* artifacts-mac/ || true
110+
EXIT_CODE=$(cat TEST_EXIT_CODE)
111+
if [ $EXIT_CODE != 0 ]; then
112+
exit $EXIT_CODE
113+
fi
114+
exit $SCRIPT_EXIT_CODE
115+
- name: Upload artifacts
116+
if: ${{ always() && github.event_name == 'pull_request' }}
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: artifacts-mac
120+
path: artifacts-mac
121+
Use-Artifacts:
122+
if: ${{ github.event_name != 'workflow_dispatch' }}
123+
runs-on: ubuntu-latest
124+
needs:
125+
- L10N-MacOS
126+
steps:
127+
- name: Checkout repository
128+
uses: actions/checkout@v4
129+
- name: Set up Python 3.11
130+
uses: actions/setup-python@v5
131+
with:
132+
python-version: "3.11"
133+
- name: Install dependencies
134+
run: |
135+
pip3 install 'pipenv==2023.11.15'
136+
pipenv install
137+
- name: Download MacOS artifact
138+
uses: actions/download-artifact@v4
139+
with:
140+
name: artifacts-mac
141+
path: artifacts-mac
142+
- name: List downloaded MacOS files
143+
run: ls artifacts-mac/
144+
- name: Run script with secret
145+
env:
146+
SLACK_KEY: ${{ secrets.SLACK_KEY }}
147+
GCP_CREDENTIAL: ${{ secrets.GCP_CREDENTIAL }}
148+
GITHUB_SHA: ${{ github.sha }}
149+
GITHUB_RUN_ID: ${{ github.run_id }}
150+
GITHUB_ACTOR: ${{ github.actor }}
151+
GITHUB_REF_NAME: ${{ github.ref_name }}
152+
run: |
153+
pipenv run python notifier.py

SELECTOR_INFO.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@ Location: about:preferences#privacy
662662
Path to .json: modules/data/about_prefs.components.json
663663
```
664664
```
665+
Selector Name: custom-tracker-options-parent
666+
Selector Data: "contentBlockingOptionCustom"
667+
Description: Parent Element in custom tracker blocking checkboxes
668+
Location: about:preferences#privacy
669+
Path to .json: modules/data/about_prefs.components.json
670+
```
671+
```
665672
Selector Name: cookies-checkbox
666673
Selector Data: "contentBlockingBlockCookiesCheckbox"
667674
Description: In Enhanced Tracking Protection, the check-box for Cookies
@@ -3036,6 +3043,12 @@ Location: Toolbar
30363043
Path to .json: modules/data/panel_ui.components.json
30373044
```
30383045
```
3046+
Selector name: panel-main-view
3047+
Description: Main body of Panel UI
3048+
Location: See above
3049+
Path to .json: modules/data/panel_ui.components.json
3050+
```
3051+
```
30393052
Selector name: sync-user-button
30403053
Selector Data: toolbarbutton[id='fxa-toolbar-menu-button']
30413054
Description: Account button
@@ -3141,6 +3154,12 @@ Location: Firefox menu
31413154
Path to .json: modules/data/panel_ui.components.json
31423155
```
31433156
```
3157+
Selector name: panel-ui-history-view
3158+
Description: Subview of Panel UI
3159+
Location: See above
3160+
Path to .json: modules/data/panel_ui.components.json
3161+
```
3162+
```
31443163
Selector name: panel-ui-history-recently-closed
31453164
Selector Data: appMenuRecentlyClosedTabs
31463165
Description: Recently closed tabs

check_l10n_test_cases.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import json
2+
import os
3+
import sys
4+
from collections import defaultdict
5+
6+
OUTPUT_FILE = "selected_l10n_mappings"
7+
8+
9+
def valid_l10n_mappings():
10+
mapping = defaultdict(set)
11+
region_paths = [d for d in os.listdir("./l10n_CM/region/")]
12+
for region_path in region_paths:
13+
if region_path != "Unified.json":
14+
region = region_path.split(".")[0]
15+
with open(f"./l10n_CM/region/{region_path}", "r+") as f:
16+
region_file = json.load(f)
17+
if region_file.get("sites"):
18+
for site in region_file.get("sites"):
19+
mapping[site].add(region)
20+
return mapping
21+
22+
23+
if __name__ == "__main__":
24+
l10n_mappings = valid_l10n_mappings()
25+
with open(OUTPUT_FILE, "w") as file:
26+
pass # File is created or cleared
27+
for site, regions in l10n_mappings.items():
28+
with open(OUTPUT_FILE, "a+") as fh:
29+
fh.write(f"{site} {' '.join(regions)}\n")
30+
sys.exit(0)

choose_ci_set.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ def dedupe(run_list: list, slash: str) -> list:
9393
for j, entry_b in enumerate(run_list):
9494
if i == j:
9595
continue
96-
candidate = max((i, j))
97-
if entry_a in entry_b and candidate not in removes:
98-
removes.append(candidate)
96+
candidate = max((entry_a, entry_b))
97+
cand_index = run_list.index(candidate)
98+
if entry_a in entry_b and cand_index not in removes:
99+
removes.append(cand_index)
99100

100101
removes.sort(reverse=True)
101102
for remove in removes:
@@ -228,6 +229,8 @@ def dedupe(run_list: list, slash: str) -> list:
228229
run_list.extend(ci_paths)
229230

230231
# Dedupe just in case
232+
if slash == "\\":
233+
run_list = [entry.replace("/", slash) for entry in run_list]
231234
run_list = dedupe(run_list, slash)
232235
run_list = [entry for entry in run_list if os.path.exists(entry.split("::")[0])]
233236
with open(OUTPUT_FILE, "w") as fh:

ci_l10n_pyproject_headed.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.pytest.ini_options]
2+
generate_report_on_test = true
3+
log_cli = true
4+
log_cli_level = "warn"
5+
markers = [
6+
"audio: test is reliant on audio",
7+
"headed: test must run in headed mode (e.g. uses pynput)",
8+
"incident: incident smoke tests",
9+
"unstable: temporary mark for unstable tests",
10+
"slow: test is clocked at more than 30s on modern machines",
11+
"ci: basic tests to run in ci",
12+
"locale_de: tests run in DE locale versions",
13+
"locale_fr: tests run in FR locale versions",
14+
"locale_gb: tests run in GB locale versions",
15+
"noxvfb: tests that should not run in xvfb sessions"
16+
]
17+
18+
addopts = "-vs --ci -n auto --json-report --json-report-file artifacts/report_headed.json --reruns 3 --reruns-delay 2 --html=artifacts/report_headed.html"
19+
20+
[tool.ruff]
21+
target-version = "py310"

ci_pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
testpaths = [
18-
"tests"
19-
]
17+
2018
addopts = "-vs --ci --run-headless --json-report --json-report-file artifacts/report.json --reruns 3 --reruns-delay 3 -m 'not incident and not unstable and not headed' --html=artifacts/report.html"
2119

2220
[tool.ruff]

ci_pyproject_headed.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
testpaths = [
18-
"tests"
19-
]
2017
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json --reruns 3 --reruns-delay 2 -m 'not incident and not unstable and headed' --html=artifacts/report_headed.html"
2118

2219
[tool.ruff]

ci_xvfb_pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
testpaths = [
18-
"tests"
19-
]
2017
addopts = "-vs --ci --run-headless --json-report --json-report-file artifacts/report.json --reruns 3 --reruns-delay 3 -m 'not unstable and not headed and not noxvfb' --html=artifacts/report.html"
2118

2219
[tool.ruff]

ci_xvfb_pyproject_headed.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
testpaths = [
18-
"tests"
19-
]
2017
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json --reruns 3 --reruns-delay 2 -m 'not unstable and not noxvfb and headed' --html=artifacts/report_headed.html"
2118

2219
[tool.ruff]

0 commit comments

Comments
 (0)