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
|
||||
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()
|
||||
|
||||
|
@ -617,7 +617,7 @@ class AppHarness:
|
||||
if self.frontend_url is None:
|
||||
raise RuntimeError("Frontend is not running.")
|
||||
want_headless = False
|
||||
if os.environ.get("APP_HARNESS_HEADLESS"):
|
||||
if environment.APP_HARNESS_HEADLESS.get:
|
||||
want_headless = True
|
||||
if driver_clz is None:
|
||||
requested_driver = os.environ.get("APP_HARNESS_DRIVER", "Chrome")
|
||||
|
@ -6,6 +6,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from reflex.config import environment
|
||||
from reflex.testing import AppHarness, AppHarnessProd
|
||||
|
||||
DISPLAY = None
|
||||
@ -21,7 +22,7 @@ def xvfb():
|
||||
Yields:
|
||||
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]
|
||||
SmartDisplay,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user