Skip to content

Commit ac6b5e0

Browse files
committed
debug internalerror
1 parent 545152a commit ac6b5e0

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.github/workflows/smoke.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
pipenv install;
2828
- name: Run Smoke Tests in Win
2929
run: |
30-
pipenv run pytest --fx-executable ./firefox/firefox -n 4 .
30+
pipenv run pytest --fx-executable ./firefox/firefox tests/security_and_privacy/test_rando.py
3131
mv artifacts artifacts-win
3232
- name: Upload artifacts
3333
uses: actions/upload-artifact@v4
@@ -55,7 +55,7 @@ jobs:
5555
pipenv install;
5656
- name: Run Smoke Tests in MacOS
5757
run: |
58-
pipenv run pytest --fx-executable ./firefox/firefox -n 4 tests
58+
pipenv run pytest --fx-executable ./firefox/firefox tests/security_and_privacy/test_rando.py
5959
mv artifacts artifacts-mac
6060
- name: Upload artifacts
6161
uses: actions/upload-artifact@v4

conftest.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
import datetime
12
import logging
23
import os
34
import platform
4-
import datetime
55
from typing import Callable, List, Tuple
66

77
import pytest
88
from selenium import webdriver
99
from selenium.common.exceptions import WebDriverException
10-
from selenium.webdriver.firefox.options import Options
1110
from selenium.webdriver import Firefox
11+
from selenium.webdriver.firefox.options import Options
12+
13+
# pipenv run pytest --fx-executable ./firefox/firefox -n 4 .
1214

1315
def screenshot_content(driver: Firefox, opt_ci: bool, test_name: str) -> None:
1416
"""
@@ -26,14 +28,19 @@ def screenshot_content(driver: Firefox, opt_ci: bool, test_name: str) -> None:
2628
driver.save_screenshot(fullpath)
2729
return
2830

31+
2932
def log_content(opt_ci: bool, driver: Firefox, test_name: str) -> None:
3033
"""
3134
Logs the current browser content, with the appropriate test name and date for reference.
3235
"""
3336
artifacts_loc = "artifacts" if opt_ci else ""
3437
current_time = str(datetime.datetime.now())
35-
fullpath_chrome = os.path.join(artifacts_loc, f"{test_name}_{current_time}_content.html")
36-
fullpath_content = os.path.join(artifacts_loc, f"{test_name}_{current_time}_chrome.html")
38+
fullpath_chrome = os.path.join(
39+
artifacts_loc, f"{test_name}_{current_time}_content.html"
40+
)
41+
fullpath_content = os.path.join(
42+
artifacts_loc, f"{test_name}_{current_time}_chrome.html"
43+
)
3744

3845
# Save Chrome context page source
3946
with open(fullpath_chrome, "w") as fh:
@@ -47,6 +54,7 @@ def log_content(opt_ci: bool, driver: Firefox, test_name: str) -> None:
4754
fh.write(output_contents)
4855
return
4956

57+
5058
def pytest_exception_interact(node, call, report):
5159
"""
5260
Method that wraps all test execution, on any exception/failure an artifact with the information about the failure is kept.
@@ -55,6 +63,7 @@ def pytest_exception_interact(node, call, report):
5563
try:
5664
test_name = node.name
5765
logging.info(f"Handling exception for test: {test_name}")
66+
logging.info(node.funcargs)
5867
driver = node.funcargs["driver"]
5968
opt_ci = node.funcargs["opt_ci"]
6069
if driver:
@@ -184,7 +193,7 @@ def driver(
184193
set_prefs: List[Tuple],
185194
opt_ci: bool,
186195
opt_window_size: str,
187-
env_prep
196+
env_prep,
188197
):
189198
"""
190199
Return the webdriver object.
@@ -285,6 +294,7 @@ def log_page_content(driver: webdriver.Firefox, opt_ci: bool):
285294
"""
286295
Function that saves the html content into the artifacts on a failed test
287296
"""
297+
288298
def _log_page_content(opt_ci: bool):
289299
artifacts_loc = "artifacts" if opt_ci else ""
290300
fullpath_chrome = os.path.join(artifacts_loc, "page_source_chrome.html")
@@ -302,4 +312,4 @@ def _log_page_content(opt_ci: bool):
302312
output_contents = driver.page_source.replace("><", ">\n<")
303313
fh.write(output_contents)
304314

305-
return _log_page_content(opt_ci)
315+
return _log_page_content(opt_ci)

taskcluster/kinds/run-smoke-tests/kind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tasks:
3131
./collect_executables.sh;
3232
mv ./ci_pyproject.toml ./pyproject.toml;
3333
pipenv install;
34-
pipenv run pytest --fx-executable ./firefox/firefox -n 4 .
34+
pipenv run pytest --fx-executable ./firefox/firefox tests/security_and_privacy/test_rando.py
3535
notify:
3636
recipients:
3737
- type: slack-channel
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_rando():
2+
assert 1 == 2

0 commit comments

Comments
 (0)