Skip to content

fix(tests): skip SearXNG migration tests on Windows - #6107

Open
Christian-Sidak wants to merge 1 commit into
odysseus-dev:devfrom
Christian-Sidak:fix/issue-6067
Open

fix(tests): skip SearXNG migration tests on Windows#6107
Christian-Sidak wants to merge 1 commit into
odysseus-dev:devfrom
Christian-Sidak:fix/issue-6067

Conversation

@Christian-Sidak

@Christian-Sidak Christian-Sidak commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Guard the two POSIX-only calls in scripts/migrate_searxng_settings.py (os.fchown and os.O_DIRECTORY) behind sys.platform != "win32" checks, and add a module-level pytestmark to skip all tests in tests/test_searxng_settings_migration.py on 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

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by accident, click "Edit" on this PR and change the base.

Linked Issue

Fixes #6067.

Type of Change

  • Bug fix (non-breaking -- fixes a confirmed issue)
  • New feature (non-breaking -- adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs -- this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above -- no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.
  • I did not run the app/runtime validation and stated that gap in How to Test. Leave this unchecked when the app-run box above is checked.

How to Test

  1. Run python -m pytest -q tests/test_searxng_settings_migration.py on Linux/macOS -- all tests should pass as before.
  2. On Windows: 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.
  3. Verify the pytestmark skip: python -m pytest tests/test_searxng_settings_migration.py --collect-only on 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 insert use_default_settings: true and preserve mode 0o640 on a temp file. python -m py_compile scripts/migrate_searxng_settings.py and git diff --check pass.

Visual / UI changes -- REQUIRED if you touched anything that renders

Not applicable: no static, template, style, or rendering files changed.

  • Screenshot or short clip of the change in the running app, attached below.
  • Style match: the change uses Odysseus's existing visual language.
  • No new component patterns.
  • I am not an LLM agent submitting a bulk PR.

Screenshots / clips

N/A -- no rendering code changed.

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>
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ PR description is complete; validation evidence is still outstanding

Changed-file classification: backend/runtime.

Author-reported runtime / visual state

  • The author explicitly reports that app/runtime validation was not performed.

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.

@github-actions github-actions Bot added needs work PR description incomplete — please update before review needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap and removed needs work PR description incomplete — please update before review labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SearXNG migration tests execute POSIX-only paths on Windows

1 participant