summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-02-06 14:23:38 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-02-07 17:05:06 +0100
commitd45dea56c5030366115b4ac29e23e3ccd88e2a50 (patch)
treecc7ff6b36d5997aae9c091f96665646d86429c8a
parent8c610404bdf20cefd05c9e8f2f5a52d835f242a3 (diff)
[fix] selenium: binary is not a Firefox executable
Since Ubuntu installs firefox frrom snap, we can't use any longer ``Browser('firefox')``. [1] https://github.com/searxng/searxng/pull/3663#issuecomment-2255963036 [2] https://splinter.readthedocs.io/en/latest/drivers/firefox.html#custom-binary-path Suggested-by: @allendema Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r--.github/workflows/integration.yml15
-rw-r--r--tests/robot/__main__.py4
-rwxr-xr-xutils/searxng.sh6
3 files changed, 7 insertions, 18 deletions
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index acc9b0255..bcf539581 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -23,26 +23,11 @@ jobs:
- name: Install Ubuntu packages
run: |
sudo ./utils/searxng.sh install packages
- sudo apt install firefox
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- - name: Cache Python dependencies
- id: cache-python
- uses: actions/cache@v4
- with:
- path: |
- ./local
- ./.nvm
- ./node_modules
- key: python-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements*.txt', 'setup.py') }}
- - name: Install Python dependencies
- if: steps.cache-python.outputs.cache-hit != 'true'
- run: |
- make V=1 install
- make V=1 gecko.driver
- name: Run tests
run: make V=1 ci.test
diff --git a/tests/robot/__main__.py b/tests/robot/__main__.py
index 7f380aeda..0b438745e 100644
--- a/tests/robot/__main__.py
+++ b/tests/robot/__main__.py
@@ -7,6 +7,7 @@ import os
import subprocess
import traceback
import pathlib
+import shutil
from splinter import Browser
@@ -53,6 +54,9 @@ class SearxRobotLayer:
def run_robot_tests(tests):
print('Running {0} tests'.format(len(tests)))
+ print(f'{shutil.which("geckodriver")}')
+ print(f'{shutil.which("firefox")}')
+
for test in tests:
with Browser('firefox', headless=True, profile_preferences={'intl.accept_languages': 'en'}) as browser:
test(browser)
diff --git a/utils/searxng.sh b/utils/searxng.sh
index a1bce5f9f..c6c9d5ea8 100755
--- a/utils/searxng.sh
+++ b/utils/searxng.sh
@@ -62,7 +62,7 @@ uwsgi uwsgi-plugin-python3
git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev"
SEARXNG_BUILD_PACKAGES_debian="\
-firefox graphviz imagemagick texlive-xetex librsvg2-bin
+graphviz imagemagick texlive-xetex librsvg2-bin
texlive-latex-recommended texlive-extra-utils fonts-dejavu
latexmk shellcheck"
@@ -74,7 +74,7 @@ uwsgi uwsgi-plugin-python
git base-devel libxml2"
SEARXNG_BUILD_PACKAGES_arch="\
-firefox graphviz imagemagick texlive-bin extra/librsvg
+graphviz imagemagick texlive-bin extra/librsvg
texlive-core texlive-latexextra ttf-dejavu shellcheck"
# dnf packages
@@ -85,7 +85,7 @@ uwsgi uwsgi-plugin-python3
git @development-tools libxml2 openssl"
SEARXNG_BUILD_PACKAGES_fedora="\
-firefox graphviz graphviz-gd ImageMagick librsvg2-tools
+graphviz graphviz-gd ImageMagick librsvg2-tools
texlive-xetex-bin texlive-collection-fontsrecommended
texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts
dejavu-sans-mono-fonts ShellCheck"