From 41526c261dc297363298e4cdcbe322f0a8ba2af5 Mon Sep 17 00:00:00 2001 From: sea-kelp <66500457+sea-kelp@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:52:27 -0800 Subject: [PATCH] Remove xvfb dependency --- Dockerfile | 2 +- OpenOversight/tests/conftest.py | 10 +++------- poetry.lock | 12 +----------- pyproject.toml | 1 - 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91b66143d..16e12c045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /usr/src/app # Install packages depending on ENV arg from docker-compose ARG BASE_PACKAGES="gcc libpq-dev libjpeg62-turbo-dev libsqlite3-0 zlib1g-dev" -ARG DEV_PACKAGES="firefox-esr xvfb" +ARG DEV_PACKAGES="firefox-esr" RUN if [ "$IS_PROD" = "true" ]; then \ PACKAGES_TO_INSTALL="$BASE_PACKAGES"; \ else \ diff --git a/OpenOversight/tests/conftest.py b/OpenOversight/tests/conftest.py index 2fbac4730..6ec6f70f2 100644 --- a/OpenOversight/tests/conftest.py +++ b/OpenOversight/tests/conftest.py @@ -20,7 +20,6 @@ from selenium.webdriver.firefox.webdriver import WebDriver as Firefox from sqlalchemy.orm import scoped_session, sessionmaker from webdriver_manager.firefox import GeckoDriverManager -from xvfbwrapper import Xvfb from OpenOversight.app import create_app from OpenOversight.app.models.database import ( @@ -901,12 +900,10 @@ def server(app, server_port): @pytest.fixture(scope="session") def browser(app, server): - # start headless webdriver - vdisplay = Xvfb() - vdisplay.start() - options = FirefoxOptions() - options.headless = True + options.add_argument("--headless") + options.add_argument("--width=1024") + options.add_argument("--height=768") service = FirefoxService( executable_path=GeckoDriverManager().install(), log_path="/tmp/geckodriver.log" @@ -917,4 +914,3 @@ def browser(app, server): # shutdown headless webdriver driver.quit() - vdisplay.stop() diff --git a/poetry.lock b/poetry.lock index e59551d75..da39fe0de 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3222,17 +3222,7 @@ files = [ SQLAlchemy = ">=0.7.10" WTForms = ">=1.0.5" -[[package]] -name = "xvfbwrapper" -version = "0.2.9" -description = "run headless display inside X virtual framebuffer (Xvfb)" -optional = false -python-versions = "*" -files = [ - {file = "xvfbwrapper-0.2.9.tar.gz", hash = "sha256:bcf4ae571941b40254faf7a73432dfc119ad21ce688f1fdec533067037ecfc24"}, -] - [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "81c20fc287ac179d96829c6fb523140a29ccb6376f157a3cf40397857b4bd75e" +content-hash = "2fea6410b13cb2bb11d56ec81921797d32580e4bc86fc98fe833d48816601c96" diff --git a/pyproject.toml b/pyproject.toml index 305594f38..37fd20b9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,6 @@ selenium = "4.17.2" sphinx = "7.0.1" sphinx-autobuild = "2021.3.14" webdriver-manager = "3.8.6" -xvfbwrapper = "0.2.9" [build-system] requires = ["poetry-core"]