Skip to content

Commit ac250a1

Browse files
committed
mark tests that fail in xvfb sessions
1 parent 5357840 commit ac250a1

File tree

12 files changed

+57
-2
lines changed

12 files changed

+57
-2
lines changed

.github/workflows/smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ jobs:
255255
pip3 install 'pipenv==2023.11.15';
256256
pip3 install 'ruff>=0.4.8,<0.5';
257257
rm ./pyproject.toml;
258-
mv ./ci_pyproject.toml ./pyproject.toml;
258+
mv ./ci_xvfb_pyproject.toml ./pyproject.toml;
259259
pipenv install;
260260
./collect_executables.sh
261261
./firefox/firefox --version;
@@ -275,7 +275,7 @@ jobs:
275275
env:
276276
FX_EXECUTABLE: ./firefox/firefox
277277
run: |
278-
mv ./ci_pyproject_headed.toml ./pyproject.toml;
278+
mv ./ci_xvfb_pyproject_headed.toml ./pyproject.toml;
279279
pipenv run python choose_ci_set.py
280280
DISPLAY=:99 pipenv run pytest --fx-executable="$FX_EXECUTABLE" $(cat selected_tests) || TEST_EXIT_CODE=$?
281281
exit $TEST_EXIT_CODE

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)