fix(tests): skip SearXNG migration tests on Windows - #6107
Open
Christian-Sidak wants to merge 1 commit into
Open
fix(tests): skip SearXNG migration tests on Windows#6107Christian-Sidak wants to merge 1 commit into
Christian-Sidak wants to merge 1 commit into
Conversation
The SearXNG settings migration script uses POSIX-only os.fchown and os.O_DIRECTORY, which CPython does not expose on Windows. The migration runs exclusively inside the Linux SearXNG container, so native Windows contributors should not see failures from the test suite. Add a module-level pytestmark to skip all tests in test_searxng_settings_migration.py on win32, matching the existing convention in test_app_db_permissions.py. Guard os.fchown and the os.O_DIRECTORY directory-fsync path in scripts/migrate_searxng_settings.py behind sys.platform != "win32" checks so the module can be safely imported on Windows without AttributeError. Fixes odysseus-dev#6067 Signed-off-by: Christian Sidak <christian@sentineltech.eu> Signed-off-by: Christian-Sidak <61099993+Christian-Sidak@users.noreply.github.com>
|
Changed-file classification: backend/runtime. Author-reported runtime / visual state
Checkboxes are author attestations. GitHub Actions results remain the execution evidence for CI; this check does not prove that a local command ran. This comment updates automatically when the description or changed files change. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Guard the two POSIX-only calls in
scripts/migrate_searxng_settings.py(os.fchownandos.O_DIRECTORY) behindsys.platform != "win32"checks, and add a module-levelpytestmarkto skip all tests intests/test_searxng_settings_migration.pyon Windows. The migration runs exclusively inside the Linux SearXNG container; the POSIX ownership and directory-fsync guarantees are preserved on all Linux paths.Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Fixes #6067.
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
python -m pytest -q tests/test_searxng_settings_migration.pyon Linux/macOS -- all tests should pass as before.python -c "import importlib.util; spec = importlib.util.spec_from_file_location('m', 'scripts/migrate_searxng_settings.py'); m = importlib.util.module_from_spec(spec); spec.loader.exec_module(m)"-- should import without AttributeError.python -m pytest tests/test_searxng_settings_migration.py --collect-onlyon Windows shows all tests as skipped with the platform reason.The POSIX ownership (
fchown) and directory-fsync (O_DIRECTORY) paths remain intact on non-Windows systems. On macOS the migration was verified to correctly insertuse_default_settings: trueand preserve mode 0o640 on a temp file.python -m py_compile scripts/migrate_searxng_settings.pyandgit diff --checkpass.Visual / UI changes -- REQUIRED if you touched anything that renders
Not applicable: no static, template, style, or rendering files changed.
Screenshots / clips
N/A -- no rendering code changed.