From c08ae955e51e3ea284441b351c400ed4ebf8a5a0 Mon Sep 17 00:00:00 2001 From: Aling33 <152494711+Aling33@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:37:37 +0800 Subject: [PATCH] test(config): skip the config-upgrade cases that need Git Bash (#7246) `test_config_version.py` guards its shell-script cases with `@pytest.mark.skipif(SCRIPT_BASH is None, ...)`, except for three `version_45` migration tests added later. On a host without Git Bash on PATH those tests pass `None` as the executable and fail with `TypeError: expected str, bytes or os.PathLike object, not NoneType` instead of skipping like their siblings, so the module reads as broken rather than inapplicable. Verified with `PATH` reduced to `%SystemRoot%\System32`: - before: the three tests failed with that TypeError - after: the three tests skip like the rest of the shell-script cases --- backend/tests/test_config_version.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/tests/test_config_version.py b/backend/tests/test_config_version.py index 44d9a765c0..dde03bcd23 100644 --- a/backend/tests/test_config_version.py +++ b/backend/tests/test_config_version.py @@ -302,6 +302,7 @@ def test_version_41_tools_only_ragflow_config_enables_knowledge_capability(tmp_p assert upgraded["tools"][0]["base_url"] == "http://legacy-ragflow:9380" +@pytest.mark.skipif(SCRIPT_BASH is None, reason="repo shell-script tests need Git Bash on Windows") def test_version_45_tools_only_ragflow_config_runs_knowledge_migration(tmp_path): """The knowledge migration must run for configs at the former base version.""" import subprocess @@ -351,6 +352,7 @@ def test_version_45_tools_only_ragflow_config_runs_knowledge_migration(tmp_path) assert upgraded["tools"][0]["base_url"] == "http://legacy-ragflow:9380" +@pytest.mark.skipif(SCRIPT_BASH is None, reason="repo shell-script tests need Git Bash on Windows") def test_version_45_tools_only_lightrag_config_keeps_knowledge_tool_available(tmp_path): """Upgrading a configured LightRAG provider must enable the new knowledge gate.""" import subprocess @@ -408,6 +410,7 @@ def test_version_45_tools_only_lightrag_config_keeps_knowledge_tool_available(tm assert "knowledge_search" in {tool.name for tool in tools} +@pytest.mark.skipif(SCRIPT_BASH is None, reason="repo shell-script tests need Git Bash on Windows") def test_version_45_lightrag_config_preserves_explicit_disabled_gate(tmp_path): """Migration must not override an operator's explicit knowledge gate value.""" import subprocess