Skip to content

Commit 565deb2

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge branch 'main' into Hani/refactor_pass_manager_batch2
2 parents 02cc92a + f2c9c89 commit 565deb2

33 files changed

+199
-148
lines changed

.github/workflows/smoke.yml

Lines changed: 106 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Mac and Windows Smoke
2+
name: Smoke Test Execution
33

44
run-name: ${{ github.actor }} is running smoke tests
55
on:
@@ -14,6 +14,20 @@ on:
1414
job_to_run:
1515
required: true
1616
type: string
17+
workflow_dispatch:
18+
inputs:
19+
win_installer_link:
20+
description: 'The link to the Windows installer (win64) for the Fx under test'
21+
required: false
22+
type: string
23+
mac_installer_link:
24+
description: 'The link to the macOS installer for the Fx under test'
25+
required: false
26+
type: string
27+
linux_tarball_link:
28+
description: 'The link to the Linux tarball (linux-x86_64) for the Fx under test'
29+
required: false
30+
type: string
1731
env:
1832
FX_CHANNEL: ${{ inputs.channel }}
1933
TESTRAIL_BASE_URL: ${{ secrets.TESTRAIL_BASE_URL }}
@@ -23,7 +37,7 @@ env:
2337

2438
jobs:
2539
Smoke-Windows:
26-
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' }}
40+
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
2741
runs-on: windows-latest
2842
steps:
2943
- name: Create app token
@@ -40,7 +54,15 @@ jobs:
4054
uses: actions/setup-python@v5
4155
with:
4256
python-version: "3.11"
43-
- name: Set Environment
57+
- name: Set Environment (Manual)
58+
if: ${{ inputs.win_installer_link }}
59+
run: |
60+
$env_contents = @"
61+
MANUAL='true'
62+
"@
63+
New-item -Name .env -Value $env_contents -ItemType File -Force
64+
Write-Host "Running smoke tests on supplied executable"
65+
- name: Set Environment (Scheduled Beta)
4466
if: ${{ inputs.job_to_run == 'Smoke-Windows' }}
4567
run: |
4668
$env_contents = @"
@@ -65,12 +87,19 @@ jobs:
6587
unzip geckodriver.zip
6688
shell: pwsh
6789
- name: Download Beta
90+
if: ${{ !inputs.win_installer_link }}
6891
run: |
6992
$fx_url = (pipenv run python collect_executables.py) -join "`n"
7093
echo $fx_url
7194
Invoke-WebRequest -Uri $fx_url -OutFile "${{ github.workspace }}\setup.exe"
7295
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
7396
shell: pwsh
97+
- name: Download Executable
98+
if: ${{ inputs.win_installer_link }}
99+
run: |
100+
Invoke-WebRequest -Uri ${{ inputs.win_installer_link }} -OutFile "${{ github.workspace }}\setup.exe"
101+
New-Item -ItemType Directory -Path "C:\Program Files\Custom Firefox" -Force
102+
shell: pwsh
74103
- name: Install Beta
75104
id: setup
76105
run: |
@@ -117,7 +146,7 @@ jobs:
117146
name: artifacts-win
118147
path: artifacts-win
119148
Smoke-MacOS:
120-
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' }}
149+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' || inputs.mac_installer_link }}
121150
runs-on: macos-latest
122151
steps:
123152
- name: Create app token
@@ -139,20 +168,29 @@ jobs:
139168
python check_test_cases.py
140169
exit $?
141170
echo "Triggered by event: ${{ github.event_name }}"
142-
- name: Set Environment
171+
- name: Set Environment (Scheduled Beta)
143172
if: ${{ inputs.job_to_run == 'Smoke-MacOS' }}
144173
run: |
145174
echo "TESTRAIL_REPORT='true'" >> "$GITHUB_ENV";
146175
echo "Running report for most recent Beta on MacOS";
176+
- name: Set Environment (Manual)
177+
if: ${{ inputs.mac_installer_link }}
178+
run: |
179+
echo "MANUAL='true'" >> "$GITHUB_ENV";
180+
echo "Running smoke tests on supplied executable";
147181
- name: Install dependencies
148-
id: setup
149182
run: |
150183
mkdir -p artifacts;
151184
pip3 install 'pipenv==2023.11.15';
152185
pip3 install 'ruff>=0.4.8,<0.5';
153186
rm ./pyproject.toml;
154187
mv ./ci_pyproject.toml ./pyproject.toml;
155-
pipenv install;
188+
pipenv install
189+
- name: Install Fx
190+
id: setup
191+
env:
192+
MANUAL_DOWNLOAD_LINK: ${{ inputs.mac_installer_link }}
193+
run:
156194
echo app_name=$(bash ./collect_executables.sh | xargs -0 ./parse_executables.sh) >> "$GITHUB_OUTPUT"
157195
- name: Run Smoke Tests in MacOS
158196
if: steps.setup.conclusion == 'success'
@@ -181,8 +219,69 @@ jobs:
181219
with:
182220
name: artifacts-mac
183221
path: artifacts-mac
222+
Smoke-Linux:
223+
if: ${{ inputs.linux_tarball_link }}
224+
runs-on: ubuntu-latest
225+
steps:
226+
- name: Create app token
227+
uses: actions/create-github-app-token@v1
228+
id: app-token
229+
with:
230+
app-id: ${{ secrets.BOT_CLIENT_ID }}
231+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
232+
- name: Checkout repository
233+
uses: actions/checkout@v4
234+
with:
235+
token: ${{ steps.app-token.outputs.token }}
236+
- name: Set up Python 3.11
237+
uses: actions/setup-python@v5
238+
with:
239+
python-version: "3.11"
240+
- name: Check test case numbers
241+
run: |
242+
python check_test_cases.py
243+
exit $?
244+
echo "Triggered by event: ${{ github.event_name }}"
245+
- name: Install dependencies
246+
id: setup
247+
env:
248+
MANUAL_DOWNLOAD_LINK: ${{ inputs.linux_tarball_link }}
249+
run: |
250+
echo "MANUAL='true'" >> "$GITHUB_ENV";
251+
echo "Running smoke tests on supplied executable";
252+
sudo apt install gnome-screenshot
253+
uname -m;
254+
mkdir -p artifacts;
255+
pip3 install 'pipenv==2023.11.15';
256+
pip3 install 'ruff>=0.4.8,<0.5';
257+
rm ./pyproject.toml;
258+
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
259+
pipenv install;
260+
./collect_executables.sh
261+
./firefox/firefox --version;
262+
#. ./keyring-unlock.sh;
263+
- name: Run Smoke Tests in Ubuntu
264+
if: steps.setup.conclusion == 'success'
265+
env:
266+
FX_EXECUTABLE: ./firefox/firefox
267+
run: |
268+
"$FX_EXECUTABLE" --version;
269+
pipenv run python choose_ci_set.py;
270+
Xvfb :99 -screen 0 '1600x1200x24' > artifacts/xvfb.log &
271+
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" -n 4 $(cat selected_tests) || TEST_EXIT_CODE=$?
272+
exit $TEST_EXIT_CODE
273+
- name: Run Smoke Tests in Ubuntu (Headed)
274+
if: steps.setup.conclusion == 'success' && always()
275+
env:
276+
FX_EXECUTABLE: ./firefox/firefox
277+
run: |
278+
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
279+
pipenv run python choose_ci_set.py
280+
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
281+
exit $TEST_EXIT_CODE
184282
185283
Use-Artifacts:
284+
if: ${{ github.event_name != 'workflow_dispatch' }}
186285
runs-on: ubuntu-latest
187286
needs:
188287
- Smoke-Windows

choose_ci_set.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ def dedupe(run_list: list, slash: str) -> list:
107107
if __name__ == "__main__":
108108
if os.path.exists(".env"):
109109
with open(".env") as fh:
110-
if "TESTRAIL_REPORT='true'" in fh.read():
110+
contents = fh.read()
111+
if "TESTRAIL_REPORT='true'" in contents:
111112
os.environ["TESTRAIL_REPORT"] = "true"
113+
if "RUN_ALL='true'" in contents:
114+
os.environ["MANUAL"] = "true"
112115

113-
if os.environ.get("TESTRAIL_REPORT"):
114-
# Run all tests if this is a scheduled beta
116+
if os.environ.get("TESTRAIL_REPORT") or os.environ.get("MANUAL"):
117+
# Run all tests if this is a scheduled beta or a manual run
115118
with open(OUTPUT_FILE, "w") as fh:
116119
fh.write("tests")
117120
sys.exit(0)

ci_xvfb_pyproject.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
testpaths = [
18+
"tests"
19+
]
20+
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"
21+
22+
[tool.ruff]
23+
target-version = "py310"

ci_xvfb_pyproject_headed.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
]
16+
testpaths = [
17+
"tests"
18+
]
19+
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"
20+
21+
[tool.ruff]
22+
target-version = "py310"

collect_executables.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@ UNAME_A=$(uname -a)
44

55
if [[ "$UNAME_A" == *"Darwin"* ]]
66
then
7-
curl -o Firefox.dmg -L "$(pipenv run python collect_executables.py)"
7+
if [ -n "$MANUAL_DOWNLOAD_LINK" ]
8+
then
9+
curl -o Firefox.dmg -L "${MANUAL_DOWNLOAD_LINK}"
10+
else
11+
curl -o Firefox.dmg -L "$(pipenv run python collect_executables.py)"
12+
fi
813
hdiutil attach Firefox.dmg
914
else
10-
pipenv run python collect_executables.py
11-
curl -o firefox.tar.xz -L "$(pipenv run python collect_executables.py)"
15+
if [ -n "$MANUAL_DOWNLOAD_LINK" ]
16+
then
17+
curl -o firefox.tar.xz -L "${MANUAL_DOWNLOAD_LINK}"
18+
else
19+
pipenv run python collect_executables.py
20+
curl -o firefox.tar.xz -L "$(pipenv run python collect_executables.py)"
21+
fi
1222
tar xf firefox.tar.xz
1323
fi
1424
curl -o geckodriver.tar.gz -L "$(pipenv run python collect_executables.py -g)"

tests/address_bar_and_search/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
@pytest.fixture()
55
def suite_id():
6-
return ("18215", "Address Bar and Search 89+")
6+
return ("65334", "Address Bar 138+")
77

88

99
@pytest.fixture(scope="session")

tests/address_bar_and_search/test_adaptive_history_autofill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
@pytest.fixture()
1717
def test_case():
18-
return "1814373"
18+
return "3029070"
1919

2020

2121
@pytest.fixture()

tests/address_bar_and_search/test_add_engine_address_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@pytest.fixture()
1111
def test_case():
12-
return "1365478"
12+
return "3029002"
1313

1414

1515
@pytest.fixture()

tests/address_bar_and_search/test_addon_suggestion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
@pytest.fixture()
2222
def test_case():
23-
return "2234714"
23+
return "3029292"
2424

2525

2626
@pytest.fixture()
@@ -31,6 +31,7 @@ def add_to_prefs_list():
3131
]
3232

3333

34+
@pytest.mark.noxvfb
3435
def test_addon_suggestion_based_on_search_input(driver: Firefox):
3536
"""
3637
C2234714 - Verify that the address bar suggests relevant add-ons based on search input.

tests/address_bar_and_search/test_default_search_provider_change_awesome_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@pytest.fixture()
1313
def test_case():
14-
return "2860208"
14+
return "3028795"
1515

1616

1717
@pytest.mark.ci

0 commit comments

Comments
 (0)