You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by ze...@apache.org on 2026/10/13 11:36:07 UTC
(magpie) branch fix/test-env-isolation created (now 881b16c3)
This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a change to branch fix/test-env-isolation
in repository https://gitbox.apache.org/repos/asf/magpie.git
at 881b16c3 test: isolate container-gateway and symlink-lint fixtures from the host
This branch includes the following new commits:
new 881b16c3 test: isolate container-gateway and symlink-lint fixtures from the host
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(magpie) 01/01: test: isolate container-gateway and symlink-lint fixtures from the host
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch fix/test-env-isolation
in repository https://gitbox.apache.org/repos/asf/magpie.git
commit 881b16c3509a1295795401588aed462dabb39978
Author: Matt Topol <zo...@gmail.com>
AuthorDate: Tue Oct 13 07:33:08 2026 -0400
test: isolate container-gateway and symlink-lint fixtures from the host
Both suites failed on a developer machine with a 0002 umask and a global
gitignore listing /.claude/. container-gateway created fixture .git
directories group-writable, which the gateway correctly refuses; an
autouse fixture now pins the umask to 022. symlink-lint staged its
fixture with the global excludes file, which dropped the .claude relay
the archive test needs; _git_repo now ignores global and system git
config.
Generated-by: Claude Code (Opus 5.5)
---
tools/container-gateway/tests/test_layers.py | 16 ++++++++++++++++
tools/symlink-lint/tests/test_symlink_lint.py | 15 ++++++++++-----
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/tools/container-gateway/tests/test_layers.py b/tools/container-gateway/tests/test_layers.py
index 61e2c431..464e69dd 100644
--- a/tools/container-gateway/tests/test_layers.py
+++ b/tools/container-gateway/tests/test_layers.py
@@ -19,10 +19,26 @@
from __future__ import annotations
+import os
+from collections.abc import Iterator
from pathlib import Path
+import pytest
+
from container_gateway import layers
+
+@pytest.fixture(autouse=True)
+def _private_umask() -> Iterator[None]:
+ # The gateway refuses a group- or world-writable `.git`; pin the umask so
+ # fixture directories don't inherit a developer's 0002 and trip that guard.
+ previous = os.umask(0o022)
+ try:
+ yield
+ finally:
+ os.umask(previous)
+
+
# --- git_common_dir: shared vectors -------------------------------------------------
diff --git a/tools/symlink-lint/tests/test_symlink_lint.py b/tools/symlink-lint/tests/test_symlink_lint.py
index 187301db..53eee7cf 100644
--- a/tools/symlink-lint/tests/test_symlink_lint.py
+++ b/tools/symlink-lint/tests/test_symlink_lint.py
@@ -282,13 +282,18 @@ def test_main_returns_one_on_missing_symlink(tmp_path: Path, monkeypatch: pytest
def _git_repo(root: Path, gitattributes: str = "") -> None:
"""Init a git repo at ``root``, write ``.gitattributes``, and stage every
- file so `git write-tree` / `git archive` have a tree to work on."""
- subprocess.run(["git", "init", "-q"], cwd=root, check=True)
- subprocess.run(["git", "config", "user.email", "t@example.com"], cwd=root, check=True)
- subprocess.run(["git", "config", "user.name", "t"], cwd=root, check=True)
+ file so `git write-tree` / `git archive` have a tree to work on.
+
+ Global and system git config are ignored so a developer's
+ ``core.excludesFile`` (e.g. one ignoring ``/.claude/``) cannot drop fixture
+ files from the staged tree."""
+ env = {**os.environ, "GIT_CONFIG_GLOBAL": os.devnull, "GIT_CONFIG_NOSYSTEM": "1"}
+ subprocess.run(["git", "init", "-q"], cwd=root, check=True, env=env)
+ subprocess.run(["git", "config", "user.email", "t@example.com"], cwd=root, check=True, env=env)
+ subprocess.run(["git", "config", "user.name", "t"], cwd=root, check=True, env=env)
if gitattributes:
(root / ".gitattributes").write_text(gitattributes)
- subprocess.run(["git", "add", "-A"], cwd=root, check=True)
+ subprocess.run(["git", "add", "-A"], cwd=root, check=True, env=env)
def test_archive_single_hop_links_clean(tmp_path: Path) -> None: