Skip to content

Commit f2c9c89

Browse files
authored
Merge pull request #574 from mozilla/ben/debug-linux-manual-flow
Fix linux manual workflow
2 parents 11379f9 + ac250a1 commit f2c9c89

File tree

12 files changed

+74
-16
lines changed

12 files changed

+74
-16
lines changed

.github/workflows/smoke.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ on:
1717
workflow_dispatch:
1818
inputs:
1919
win_installer_link:
20-
description: 'The link to the Windows installer for the Fx under test'
21-
required: true
20+
description: 'The link to the Windows installer (win64) for the Fx under test'
21+
required: false
2222
type: string
2323
mac_installer_link:
2424
description: 'The link to the macOS installer for the Fx under test'
25-
required: true
25+
required: false
2626
type: string
2727
linux_tarball_link:
28-
description: 'The link to the Linux tarball for the Fx under test'
29-
required: true
28+
description: 'The link to the Linux tarball (linux-x86_64) for the Fx under test'
29+
required: false
3030
type: string
3131
env:
3232
FX_CHANNEL: ${{ inputs.channel }}
@@ -37,7 +37,7 @@ env:
3737

3838
jobs:
3939
Smoke-Windows:
40-
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
40+
if: ${{ inputs.job_to_run == 'Smoke-Windows' || github.event_name == 'pull_request' || inputs.win_installer_link }}
4141
runs-on: windows-latest
4242
steps:
4343
- name: Create app token
@@ -146,7 +146,7 @@ jobs:
146146
name: artifacts-win
147147
path: artifacts-win
148148
Smoke-MacOS:
149-
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
149+
if: ${{ inputs.job_to_run == 'Smoke-MacOS' || github.event_name == 'pull_request' || inputs.mac_installer_link }}
150150
runs-on: macos-latest
151151
steps:
152152
- name: Create app token
@@ -220,7 +220,7 @@ jobs:
220220
name: artifacts-mac
221221
path: artifacts-mac
222222
Smoke-Linux:
223-
if: ${{ github.event_name == 'workflow_dispatch' }}
223+
if: ${{ inputs.linux_tarball_link }}
224224
runs-on: ubuntu-latest
225225
steps:
226226
- name: Create app token
@@ -249,36 +249,39 @@ jobs:
249249
run: |
250250
echo "MANUAL='true'" >> "$GITHUB_ENV";
251251
echo "Running smoke tests on supplied executable";
252+
sudo apt install gnome-screenshot
253+
uname -m;
252254
mkdir -p artifacts;
253255
pip3 install 'pipenv==2023.11.15';
254256
pip3 install 'ruff>=0.4.8,<0.5';
255257
rm ./pyproject.toml;
256-
mv ./ci_pyproject.toml ./pyproject.toml;
258+
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
257259
pipenv install;
258260
./collect_executables.sh
259261
./firefox/firefox --version;
260-
. ./keyring-unlock.sh;
262+
#. ./keyring-unlock.sh;
261263
- name: Run Smoke Tests in Ubuntu
262264
if: steps.setup.conclusion == 'success'
263265
env:
264266
FX_EXECUTABLE: ./firefox/firefox
265267
run: |
266-
"$FX_EXECUTABLE" --version
267-
pipenv run python choose_ci_set.py
268-
pipenv run pytest --fx-executable="$FX_EXECUTABLE" -n 4 $(cat selected_tests) || TEST_EXIT_CODE=$?
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=$?
269272
exit $TEST_EXIT_CODE
270273
- name: Run Smoke Tests in Ubuntu (Headed)
271274
if: steps.setup.conclusion == 'success' && always()
272275
env:
273276
FX_EXECUTABLE: ./firefox/firefox
274-
REPORTABLE: true
275277
run: |
276-
mv ./ci_pyproject_headed.toml ./pyproject.toml;
278+
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
277279
pipenv run python choose_ci_set.py
278-
pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
280+
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
279281
exit $TEST_EXIT_CODE
280282
281283
Use-Artifacts:
284+
if: ${{ github.event_name != 'workflow_dispatch' }}
282285
runs-on: ubuntu-latest
283286
needs:
284287
- Smoke-Windows

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"

tests/address_bar_and_search/test_addon_suggestion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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/audio_video/test_allow_audio_video_functionality.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_case():
2323

2424
@pytest.mark.skipif(WIN_GHA, reason="Test unstable in Windows Github Actions")
2525
@pytest.mark.audio
26+
@pytest.mark.noxvfb
2627
def test_allow_audio_video_functionality(driver: Firefox):
2728
"""
2829
C330155 : 'Allow Audio and Video' functionality

tests/downloads/test_add_mime_type_doc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def delete_files_regex_string():
2525

2626

2727
@pytest.mark.skipif(WIN_GHA, reason="Test unstable in Windows Github Actions")
28+
@pytest.mark.noxvfb
2829
def test_mime_type_doc(driver: Firefox, sys_platform: str, opt_ci: bool, delete_files):
2930
"""
3031
C1756748: Verify the user can add the .doc type

tests/password_manager/test_password_csv_correctness.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_case():
1616

1717

1818
@pytest.mark.headed
19+
@pytest.mark.noxvfb
1920
def test_password_csv_correctness(
2021
driver_and_saved_logins, downloads_folder, sys_platform
2122
):

tests/password_manager/test_password_csv_export.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def test_case():
1515

1616

1717
@pytest.mark.headed
18+
@pytest.mark.noxvfb
1819
def test_password_csv_export(
1920
driver_and_saved_logins, downloads_folder, sys_platform, opt_ci
2021
):

tests/pdf_viewer/test_add_image_pdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def add_to_prefs_list():
3333

3434

3535
@pytest.mark.headed
36+
@pytest.mark.noxvfb
3637
def test_add_image_pdf(driver: Firefox, sys_platform, pdf_viewer: GenericPdf):
3738
"""
3839
C2228202: Verify that the user is able to add an image to a PDF file.

tests/pdf_viewer/test_pdf_navigation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def test_toolbar_options_cursor(driver: Firefox, pdf_viewer: GenericPdf):
144144
assert cursor_style == "auto"
145145

146146

147+
@pytest.mark.noxvfb
147148
def test_toolbar_options_rotate_cw(driver: Firefox, pdf_viewer: GenericPdf):
148149
"""
149150
C3927.5: Ensure the correct rotation is shown
@@ -162,6 +163,7 @@ def test_toolbar_options_rotate_cw(driver: Firefox, pdf_viewer: GenericPdf):
162163
)
163164

164165

166+
@pytest.mark.noxvfb
165167
def test_toolbar_options_rotate_ccw(driver: Firefox, pdf_viewer: GenericPdf):
166168
"""
167169
C3927.5: Ensure the correct rotation is shown

0 commit comments

Comments
 (0)