Merge "pytest-based tests fix HEADLESS run setting"

This commit is contained in:
Zuul
2025-07-31 09:49:44 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 6 deletions

View File

@@ -188,8 +188,8 @@ def record_video(request, report_dir, xdisplay):
@pytest.fixture(scope='session')
def xdisplay():
IS_SELENIUM_HEADLESS = os.environ.get('SELENIUM_HEADLESS', False)
if IS_SELENIUM_HEADLESS:
IS_SELENIUM_HEADLESS = os.environ.get('SELENIUM_HEADLESS', "True")
if IS_SELENIUM_HEADLESS.lower() == "true":
width, height = 1920, 1080
vdisplay = xvfbwrapper.Xvfb(width=width, height=height)
args = []

11
tox.ini
View File

@@ -62,7 +62,7 @@ commands =
[testenv:selenium-headless]
setenv =
{[testenv]setenv}
SELENIUM_HEADLESS=1
SELENIUM_HEADLESS=True
WITH_SELENIUM=1
commands =
find . -type f -name "*.pyc" -delete
@@ -82,9 +82,10 @@ commands =
passenv =
DISPLAY
FFMPEG_INSTALLED
XAUTHORITY
setenv =
INTEGRATION_TESTS=1
SELENIUM_HEADLESS=False
SELENIUM_HEADLESS=True
commands =
oslo-config-generator --namespace openstack_dashboard_integration_tests
pytest --ds=openstack_dashboard.test.settings -v -x --junitxml="{toxinidir}/test_reports/integration_test_results.xml" --html="{toxinidir}/test_reports/integration_test_results.html" --self-contained-html {posargs:{toxinidir}/openstack_dashboard/test/integration_tests}
@@ -94,8 +95,9 @@ commands =
passenv =
DISPLAY
FFMPEG_INSTALLED
XAUTHORITY
setenv =
SELENIUM_HEADLESS=1
SELENIUM_HEADLESS=True
commands =
oslo-config-generator --namespace openstack_dashboard_integration_tests
pytest -x -v -k "not federation" --junitxml="{toxinidir}/test_reports/integration_pytest_results.xml" --html="{toxinidir}/test_reports/integration_pytest_results.html" --self-contained-html {posargs:{toxinidir}/openstack_dashboard/test/selenium/integration}
@@ -105,8 +107,9 @@ commands =
passenv =
DISPLAY
FFMPEG_INSTALLED
XAUTHORITY
setenv =
SELENIUM_HEADLESS=1
SELENIUM_HEADLESS=True
commands =
oslo-config-generator --namespace openstack_dashboard_integration_tests
pytest --ds=openstack_dashboard.settings -v --junitxml="{toxinidir}/test_reports/integration_uitest_results.xml" --html="{toxinidir}/test_reports/integration_uitest_results.html" --self-contained-html {posargs:{toxinidir}/openstack_dashboard/test/selenium/ui}