Skip to content

Commit ddedb35

Browse files
committed
test: guard executable-bit assertions from Windows chmod semantics
The Windows CI job failed because `os.chmod` does not set POSIX executable bits on Windows, so `install_scripts()` cannot make `.py`/ `.sh` files executable there (nor is it needed — the interpreter is invoked explicitly). Split the install_scripts test so file-copy behavior is still verified cross-platform, and skip the executable-bit assertions on win32 (matching the repo's existing pattern).
1 parent 6329ef4 commit ddedb35

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
* text=auto eol=lf
22

3+
<<<<<<< Updated upstream
34
.github/workflows/*.lock.yml linguist-generated=true merge=ours -whitespace
45
# The project constitution is the one dogfooding artifact carried forward.
56
# Keep it exempt from git's whitespace checks (git diff --check / CI) since its
67
# generated formatting is not hand-edited.
78
.specify/memory/constitution.md -whitespace
9+
=======
10+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
11+
>>>>>>> Stashed changes

tests/integrations/test_base.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Tests for IntegrationOption, IntegrationBase, MarkdownIntegration, and primitives."""
22

3+
import sys
4+
35
import pytest
46

57
from specify_cli.integrations.base import (
@@ -451,7 +453,8 @@ def _make_integration_with_scripts(self, monkeypatch, tmp_path):
451453
)
452454
return integration
453455

454-
def test_copies_py_and_marks_executable(self, monkeypatch, tmp_path):
456+
def test_copies_all_script_files(self, monkeypatch, tmp_path):
457+
# Cross-platform: every bundled file is copied into the project.
455458
integration = self._make_integration_with_scripts(monkeypatch, tmp_path)
456459
project_root = tmp_path / "proj"
457460
project_root.mkdir()
@@ -461,6 +464,17 @@ def test_copies_py_and_marks_executable(self, monkeypatch, tmp_path):
461464
names = {p.name for p in created}
462465
assert {"common.py", "common.sh", "notes.txt"} == names
463466

467+
@pytest.mark.skipif(
468+
sys.platform == "win32", reason="chmod exec bit not reliable on Windows"
469+
)
470+
def test_marks_py_and_sh_executable(self, monkeypatch, tmp_path):
471+
integration = self._make_integration_with_scripts(monkeypatch, tmp_path)
472+
project_root = tmp_path / "proj"
473+
project_root.mkdir()
474+
manifest = IntegrationManifest("stub", project_root.resolve())
475+
476+
integration.install_scripts(project_root, manifest)
477+
464478
dest = project_root / ".specify" / "integrations" / "stub" / "scripts"
465479
py_file = dest / "common.py"
466480
sh_file = dest / "common.sh"

0 commit comments

Comments
 (0)