migrate APP_HARNESS_HEADLESS to new env var system
This commit is contained in:
parent
84057093ac
commit
f16273fa11
@ -491,6 +491,9 @@ class EnvironmentVariables:
|
|||||||
# If this env var is set to "yes", App.compile will be a no-op
|
# If this env var is set to "yes", App.compile will be a no-op
|
||||||
REFLEX_SKIP_COMPILE: EnvVar[bool] = env_var(False, internal=True)
|
REFLEX_SKIP_COMPILE: EnvVar[bool] = env_var(False, internal=True)
|
||||||
|
|
||||||
|
# Whether to run app harness tests in headless mode.
|
||||||
|
APP_HARNESS_HEADLESS: EnvVar[bool] = env_var(False)
|
||||||
|
|
||||||
|
|
||||||
environment = EnvironmentVariables()
|
environment = EnvironmentVariables()
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ class AppHarness:
|
|||||||
if self.frontend_url is None:
|
if self.frontend_url is None:
|
||||||
raise RuntimeError("Frontend is not running.")
|
raise RuntimeError("Frontend is not running.")
|
||||||
want_headless = False
|
want_headless = False
|
||||||
if os.environ.get("APP_HARNESS_HEADLESS"):
|
if environment.APP_HARNESS_HEADLESS.get:
|
||||||
want_headless = True
|
want_headless = True
|
||||||
if driver_clz is None:
|
if driver_clz is None:
|
||||||
requested_driver = os.environ.get("APP_HARNESS_DRIVER", "Chrome")
|
requested_driver = os.environ.get("APP_HARNESS_DRIVER", "Chrome")
|
||||||
|
@ -6,6 +6,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from reflex.config import environment
|
||||||
from reflex.testing import AppHarness, AppHarnessProd
|
from reflex.testing import AppHarness, AppHarnessProd
|
||||||
|
|
||||||
DISPLAY = None
|
DISPLAY = None
|
||||||
@ -21,7 +22,7 @@ def xvfb():
|
|||||||
Yields:
|
Yields:
|
||||||
the pyvirtualdisplay object that the browser will be open on
|
the pyvirtualdisplay object that the browser will be open on
|
||||||
"""
|
"""
|
||||||
if os.environ.get("GITHUB_ACTIONS") and not os.environ.get("APP_HARNESS_HEADLESS"):
|
if os.environ.get("GITHUB_ACTIONS") and not environment.APP_HARNESS_HEADLESS.get:
|
||||||
from pyvirtualdisplay.smartdisplay import ( # pyright: ignore [reportMissingImports]
|
from pyvirtualdisplay.smartdisplay import ( # pyright: ignore [reportMissingImports]
|
||||||
SmartDisplay,
|
SmartDisplay,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user