Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(ci): exercise case-insensitive paths on macOS (#1963)

Michael D'Angelo34c97c82bb31
diff --git a/plugins/codex-security/tests/test_finalize_scan_contract.py b/plugins/codex-security/tests/test_finalize_scan_contract.py
index 3baed8055..b1385f64d 100644
--- a/plugins/codex-security/tests/test_finalize_scan_contract.py
+++ b/plugins/codex-security/tests/test_finalize_scan_contract.py
@@ -941,6 +941,7 @@ The extraction root is not enforced.
self.assertIn("JSON output path cannot overwrite a scan artifact", rejected.stderr)
self.assertEqual(findings.read_bytes(), before)
+ @pytest.mark.native_macos
def test_export_entrypoint_rejects_overwriting_a_sealed_reserved_export(self) -> None:
for artifact_path in (
"exports/findings.csv",
@@ -1039,6 +1040,7 @@ The extraction root is not enforced.
self.assertNotEqual(output.read_bytes(), contents)
self.scan_dir = root
+ @pytest.mark.native_macos
def test_export_entrypoint_rejects_a_case_aliased_scan_directory(self) -> None:
self.write_sealed_scan()
alias = self.scan_dir.parent / self.scan_dir.name.swapcase()
diff --git a/plugins/codex-security/tests/test_workbench_target.py b/plugins/codex-security/tests/test_workbench_target.py
index 26982e5b7..ef6e804b2 100644
--- a/plugins/codex-security/tests/test_workbench_target.py
+++ b/plugins/codex-security/tests/test_workbench_target.py
@@ -24,6 +24,7 @@ worktree_content_digest = cast(Callable[[Path], str], WORKBENCH_TARGET["worktree
update_digest_field = cast(
Callable[[Any, bytes, bytes], None], WORKBENCH_TARGET["update_digest_field"]
)
+CASE_ALIAS = pytest.param("case", marks=pytest.mark.native_macos)
@pytest.fixture(
@@ -1186,7 +1187,7 @@ def test_directory_snapshot_preserves_target_alias_spelling(tmp_path: Path, scop
@pytest.mark.parametrize("scope", [".", "component"])
[email protected]("alias_kind", ["symlink", "case"])
[email protected]("alias_kind", ["symlink", CASE_ALIAS])
def test_submodule_checks_preserve_target_alias_spelling(
tmp_path: Path, scope: str, alias_kind: str
) -> None:
@@ -1212,7 +1213,7 @@ def test_submodule_checks_preserve_target_alias_spelling(
@pytest.mark.parametrize("content_digest", [directory_content_digest, worktree_content_digest])
[email protected]("alias_kind", ["original", "symlink", "case"])
[email protected]("alias_kind", ["original", "symlink", CASE_ALIAS])
def test_content_digest_expands_nested_git_repositories(
tmp_path: Path, content_digest: Callable[[Path], str], alias_kind: str
) -> None:
@@ -1486,6 +1487,7 @@ def test_git_context_retains_scoped_directory_spelling(tmp_path: Path, name: str
assert pathspec == scoped.name
def test_git_target_accepts_filesystem_case_aliases(tmp_path: Path) -> None:
target = tmp_path / "target"
initialize_git_repository(target)
@@ -1541,7 +1543,7 @@ def test_git_context_rejects_an_unrelated_configured_worktree(tmp_path: Path) ->
@pytest.mark.parametrize("scope", [".", "component"])
[email protected]("alias_kind", ["original", "symlink", "case"])
[email protected]("alias_kind", ["original", "symlink", CASE_ALIAS])
def test_copy_retains_alias_rooted_gitlink_exclusions(
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, scope: str, alias_kind: str
) -> None: