Skip to content

Commit be3b75e

Browse files
l10n_Reporting for linux
1 parent 017a640 commit be3b75e

File tree

4 files changed

+83
-9
lines changed

4 files changed

+83
-9
lines changed

.github/workflows/l10n.yml

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: L10N Test Execution
33

44
run-name: ${{ github.actor }} is running l10n tests
55
on:
6+
pull_request:
67
workflow_call:
78
inputs:
89
channel:
@@ -19,6 +20,10 @@ on:
1920
description: 'The link to the macOS installer for the Fx under test'
2021
required: false
2122
type: string
23+
linux_tarball_link:
24+
description: 'The link to the Linux tarball (linux-x86_64) for the Fx under test'
25+
required: false
26+
type: string
2227
env:
2328
FX_CHANNEL: ${{ inputs.channel }}
2429
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
@@ -46,11 +51,6 @@ jobs:
4651
uses: actions/setup-python@v5
4752
with:
4853
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 }}"
5454
- name: Set Environment (Scheduled Beta)
5555
if: ${{ inputs.job_to_run == 'L10N-MacOS' }}
5656
run: |
@@ -101,7 +101,6 @@ jobs:
101101
run: |
102102
mv ./ci_l10n_pyproject_headed.toml ./pyproject.toml;
103103
echo "0" > TEST_EXIT_CODE
104-
pipenv run python check_l10n_test_cases.py
105104
while IFS= read -r line; do
106105
echo "Running tests for: $line"
107106
pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
@@ -118,6 +117,79 @@ jobs:
118117
with:
119118
name: artifacts-mac
120119
path: artifacts-mac
120+
L10N-Linux:
121+
if: ${{inputs.job_to_run == 'L10N-MacOS' || inputs.linux_tarball_link }}
122+
runs-on: ubuntu-latest
123+
steps:
124+
- name: Create app token
125+
uses: actions/create-github-app-token@v1
126+
id: app-token
127+
with:
128+
app-id: ${{ secrets.BOT_CLIENT_ID }}
129+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
130+
- name: Checkout repository
131+
uses: actions/checkout@v4
132+
with:
133+
token: ${{ steps.app-token.outputs.token }}
134+
- name: Set up Python 3.11
135+
uses: actions/setup-python@v5
136+
with:
137+
python-version: "3.11"
138+
- name: Install dependencies
139+
id: setup
140+
env:
141+
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
142+
run: |
143+
echo "MANUAL='true'" >> "$GITHUB_ENV";
144+
echo "Running smoke tests on supplied executable";
145+
sudo apt install gnome-screenshot
146+
uname -m;
147+
mkdir -p artifacts;
148+
pip3 install 'pipenv==2023.11.15';
149+
pip3 install 'ruff>=0.4.8,<0.5';
150+
rm ./pyproject.toml;
151+
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
152+
pipenv install;
153+
./collect_executables.sh
154+
./firefox/firefox --version;
155+
#. ./keyring-unlock.sh;
156+
- name: Run L10N Tests in Ubuntu
157+
if: steps.setup.conclusion == 'success'
158+
env:
159+
FX_EXECUTABLE: ./firefox/firefox
160+
run: |
161+
"$FX_EXECUTABLE" --version
162+
echo "0" > TEST_EXIT_CODE
163+
pipenv run python check_l10n_test_cases.py
164+
Xvfb :99 -screen 0 '1600x1200x24' > artifacts/xvfb.log &
165+
while IFS= read -r line; do
166+
echo "Running tests for: $line"
167+
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
168+
done < selected_l10n_mappings
169+
mv artifacts artifacts-mac || true
170+
EXIT_CODE=$(cat TEST_EXIT_CODE)
171+
if [ $EXIT_CODE != 0 ]; then
172+
exit $EXIT_CODE
173+
fi
174+
exit $SCRIPT_EXIT_CODE
175+
- name: Run Smoke Tests in Ubuntu (Headed)
176+
if: steps.setup.conclusion == 'success' && always()
177+
env:
178+
FX_EXECUTABLE: ./firefox/firefox
179+
run: |
180+
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
181+
echo "0" > TEST_EXIT_CODE
182+
while IFS= read -r line; do
183+
echo "Running tests for: $line"
184+
DISPLAY=:99 pipenv run python l10n_CM/run_l10n.py --fx-executable="$FX_EXECUTABLE" $line || SCRIPT_EXIT_CODE=$?
185+
done < selected_l10n_mappings
186+
mv -n artifacts/* artifacts-mac/ || true
187+
EXIT_CODE=$(cat TEST_EXIT_CODE)
188+
if [ $EXIT_CODE != 0 ]; then
189+
exit $EXIT_CODE
190+
fi
191+
exit $SCRIPT_EXIT_CODE
192+
121193
Use-Artifacts:
122194
if: ${{ github.event_name != 'workflow_dispatch' }}
123195
runs-on: ubuntu-latest

ci_xvfb_pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
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"
17+
addopts = "-vs --ci --run-headless --json-report --json-report-file artifacts/report.json -n auto --reruns 3 --reruns-delay 3 -m 'not unstable and not headed and not noxvfb' --html=artifacts/report.html"
1818

1919
[tool.ruff]
2020
target-version = "py310"

ci_xvfb_pyproject_headed.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ markers = [
1414
"locale_gb: tests run in GB locale versions",
1515
"noxvfb: tests that should not run in xvfb sessions"
1616
]
17-
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"
17+
addopts = "-vs --ci --json-report --json-report-file artifacts/report_headed.json -n auto --reruns 3 --reruns-delay 2 -m 'not unstable and not noxvfb and headed' --html=artifacts/report_headed.html"
1818

1919
[tool.ruff]
2020
target-version = "py310"

tests/audio_video/test_allow_audio_video_functionality.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ def test_allow_audio_video_functionality(driver: Firefox):
6161
except AssertionError:
6262
sleep(2)
6363
else:
64-
pytest.fail(f"Tab sound status did not reach PLAYING after {max_retries} retries.")
64+
pytest.fail(
65+
f"Tab sound status did not reach PLAYING after {max_retries} retries."
66+
)

0 commit comments

Comments
 (0)