ci: skip POSIX permission tests on Windows (temporary, see #5842) (#5847)

Windows does not support POSIX file permissions, causing 4 test
failures on Windows CI. Skip these tests until the proper
ReplaceFileW fix lands.
This commit is contained in:
Hundao
2026-03-05 17:50:05 +08:00
committed by GitHub
parent a84b3c7867
commit 462e303a6e
2 changed files with 11 additions and 0 deletions
@@ -2,6 +2,7 @@
import json
import os
import sys
import pytest
from fastmcp import FastMCP
@@ -386,6 +387,9 @@ class TestHashlineEditAutoCleanup:
class TestHashlineEditAtomicWrite:
@pytest.mark.skipif(
sys.platform == "win32", reason="POSIX permissions not supported on Windows"
)
def test_preserves_permissions(self, tools, tmp_path):
"""Atomic write preserves original file permissions."""
hashline_edit = tools[0]["hashline_edit"]
+7
View File
@@ -2,6 +2,7 @@
import json
import os
import sys
from unittest.mock import patch
import pytest
@@ -962,6 +963,9 @@ class TestAtomicityWithReplace:
class TestAtomicWrite:
"""Tests for atomic write behavior."""
@pytest.mark.skipif(
sys.platform == "win32", reason="chmod on directories not supported on Windows"
)
def test_atomic_write_preserves_original_on_write_failure(
self, hashline_edit_fn, mock_workspace, mock_secure_path, tmp_path
):
@@ -1283,6 +1287,9 @@ class TestAllowMultiple:
class TestPermissionsPreservation:
"""Tests for file permissions preservation during atomic write."""
@pytest.mark.skipif(
sys.platform == "win32", reason="POSIX permissions not supported on Windows"
)
@pytest.mark.parametrize("mode", [0o755, 0o644])
def test_permissions_preserved_after_edit(
self, hashline_edit_fn, mock_workspace, mock_secure_path, tmp_path, mode