executet 'ruff format --check .'
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / lint-shell (push) Has been cancelled
Mark stable commit / lint-python (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / lint-shell (push) Has been cancelled
Mark stable commit / lint-python (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
This commit is contained in:
@@ -37,9 +37,7 @@ class TestIntegrationBranchCommands(unittest.TestCase):
|
||||
`pkgmgr branch open feature/test --base develop` must forward
|
||||
the name and base branch to open_branch() with cwd=".".
|
||||
"""
|
||||
self._run_pkgmgr(
|
||||
["branch", "open", "feature/test", "--base", "develop"]
|
||||
)
|
||||
self._run_pkgmgr(["branch", "open", "feature/test", "--base", "develop"])
|
||||
|
||||
mock_open_branch.assert_called_once()
|
||||
_, kwargs = mock_open_branch.call_args
|
||||
@@ -74,9 +72,7 @@ class TestIntegrationBranchCommands(unittest.TestCase):
|
||||
`pkgmgr branch close feature/test --base develop` must forward
|
||||
the name and base branch to close_branch() with cwd=".".
|
||||
"""
|
||||
self._run_pkgmgr(
|
||||
["branch", "close", "feature/test", "--base", "develop"]
|
||||
)
|
||||
self._run_pkgmgr(["branch", "close", "feature/test", "--base", "develop"])
|
||||
|
||||
mock_close_branch.assert_called_once()
|
||||
_, kwargs = mock_close_branch.call_args
|
||||
|
||||
@@ -3,15 +3,14 @@ import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class TestMakefileThreeTimes(unittest.TestCase):
|
||||
def test_make_install_three_times(self):
|
||||
with tempfile.TemporaryDirectory(prefix="makefile-3x-") as tmp:
|
||||
repo = Path(tmp)
|
||||
|
||||
# Minimal Makefile with install target
|
||||
(repo / "Makefile").write_text(
|
||||
"install:\n\t@echo install >> install.log\n"
|
||||
)
|
||||
(repo / "Makefile").write_text("install:\n\t@echo install >> install.log\n")
|
||||
|
||||
for i in range(1, 4):
|
||||
print(f"\n=== RUN {i}/3 ===")
|
||||
|
||||
@@ -114,7 +114,9 @@ class TestIntegrationInstalPKGMGRShallow(unittest.TestCase):
|
||||
# Optional XDG override for a fully isolated environment
|
||||
os.environ.setdefault("XDG_CONFIG_HOME", os.path.join(temp_home, ".config"))
|
||||
os.environ.setdefault("XDG_CACHE_HOME", os.path.join(temp_home, ".cache"))
|
||||
os.environ.setdefault("XDG_DATA_HOME", os.path.join(temp_home, ".local", "share"))
|
||||
os.environ.setdefault(
|
||||
"XDG_DATA_HOME", os.path.join(temp_home, ".local", "share")
|
||||
)
|
||||
|
||||
# 🔧 IMPORTANT FIX: allow Git to access /src safely
|
||||
configure_git_safe_directory()
|
||||
|
||||
@@ -14,17 +14,16 @@ class TestPkgmgrInstallThreeTimesNix(unittest.TestCase):
|
||||
env["HOME"] = tmp
|
||||
|
||||
# Ensure nix is found
|
||||
env["PATH"] = "/nix/var/nix/profiles/default/bin:" + os.environ.get("PATH", "")
|
||||
env["PATH"] = "/nix/var/nix/profiles/default/bin:" + os.environ.get(
|
||||
"PATH", ""
|
||||
)
|
||||
|
||||
# IMPORTANT:
|
||||
# nix run uses git+file:///src internally -> Git will reject /src if it's not a safe.directory.
|
||||
# Our test sets HOME to a temp dir, so we must provide a temp global gitconfig.
|
||||
gitconfig = tmp_path / ".gitconfig"
|
||||
gitconfig.write_text(
|
||||
"[safe]\n"
|
||||
"\tdirectory = /src\n"
|
||||
"\tdirectory = /src/.git\n"
|
||||
"\tdirectory = *\n"
|
||||
"[safe]\n\tdirectory = /src\n\tdirectory = /src/.git\n\tdirectory = *\n"
|
||||
)
|
||||
env["GIT_CONFIG_GLOBAL"] = str(gitconfig)
|
||||
|
||||
|
||||
@@ -16,10 +16,8 @@ class TestPkgmgrInstallThreeTimesVenv(unittest.TestCase):
|
||||
env["HOME"] = tmp
|
||||
|
||||
# pkgmgr kommt aus dem Projekt-venv
|
||||
env["PATH"] = (
|
||||
f"{Path.cwd() / '.venv' / 'bin'}:"
|
||||
f"{bin_dir}:"
|
||||
+ os.environ.get("PATH", "")
|
||||
env["PATH"] = f"{Path.cwd() / '.venv' / 'bin'}:{bin_dir}:" + os.environ.get(
|
||||
"PATH", ""
|
||||
)
|
||||
|
||||
# nix explizit deaktivieren → Python/Venv-Pfad
|
||||
|
||||
@@ -69,9 +69,7 @@ class TestIntegrationMakeCommands(unittest.TestCase):
|
||||
- '--preview' ensures that no destructive make commands are
|
||||
actually executed inside the container.
|
||||
"""
|
||||
self._run_pkgmgr_make(
|
||||
["make", "install", "--preview", "pkgmgr"]
|
||||
)
|
||||
self._run_pkgmgr_make(["make", "install", "--preview", "pkgmgr"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -24,9 +24,7 @@ import unittest
|
||||
|
||||
|
||||
# Resolve project root (the repo where flake.nix lives, e.g. /src)
|
||||
PROJECT_ROOT = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "..", "..")
|
||||
)
|
||||
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
|
||||
|
||||
def _run_cmd(cmd: list[str]) -> subprocess.CompletedProcess:
|
||||
@@ -69,13 +67,18 @@ class TestNixBuildPkgmgrAllDistros(unittest.TestCase):
|
||||
_run_cmd(["id"])
|
||||
|
||||
# --- nix build .#pkgmgr -L ---
|
||||
proc = _run_cmd([
|
||||
"nix",
|
||||
"--option", "sandbox", "false",
|
||||
"build", ".#pkgmgr",
|
||||
"-L",
|
||||
])
|
||||
|
||||
proc = _run_cmd(
|
||||
[
|
||||
"nix",
|
||||
"--option",
|
||||
"sandbox",
|
||||
"false",
|
||||
"build",
|
||||
".#pkgmgr",
|
||||
"-L",
|
||||
]
|
||||
)
|
||||
|
||||
if proc.returncode != 0:
|
||||
raise AssertionError(
|
||||
"nix build .#pkgmgr -L failed inside the test container.\n"
|
||||
|
||||
@@ -164,5 +164,6 @@ class TestIntegrationReleaseCommand(unittest.TestCase):
|
||||
self.assertIn("usage:", output)
|
||||
self.assertIn("pkgmgr release", output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -17,6 +17,7 @@ import sys
|
||||
import unittest
|
||||
from typing import List
|
||||
|
||||
|
||||
def _run_main(argv: List[str]) -> None:
|
||||
"""
|
||||
Helper to run main.py with the given argv.
|
||||
@@ -62,4 +63,4 @@ class TestToolsHelp(unittest.TestCase):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
||||
@@ -30,10 +30,7 @@ from test_install_pkgmgr_shallow import (
|
||||
def _make_temp_gitconfig_with_safe_dirs(home: Path) -> Path:
|
||||
gitconfig = home / ".gitconfig"
|
||||
gitconfig.write_text(
|
||||
"[safe]\n"
|
||||
"\tdirectory = /src\n"
|
||||
"\tdirectory = /src/.git\n"
|
||||
"\tdirectory = *\n"
|
||||
"[safe]\n\tdirectory = /src\n\tdirectory = /src/.git\n\tdirectory = *\n"
|
||||
)
|
||||
return gitconfig
|
||||
|
||||
|
||||
@@ -29,10 +29,7 @@ from test_install_pkgmgr_shallow import (
|
||||
def _make_temp_gitconfig_with_safe_dirs(home: Path) -> Path:
|
||||
gitconfig = home / ".gitconfig"
|
||||
gitconfig.write_text(
|
||||
"[safe]\n"
|
||||
"\tdirectory = /src\n"
|
||||
"\tdirectory = /src/.git\n"
|
||||
"\tdirectory = *\n"
|
||||
"[safe]\n\tdirectory = /src\n\tdirectory = /src/.git\n\tdirectory = *\n"
|
||||
)
|
||||
return gitconfig
|
||||
|
||||
|
||||
@@ -31,9 +31,7 @@ from typing import List
|
||||
from pkgmgr.core.config.load import load_config
|
||||
|
||||
# Resolve project root (the repo where main.py lives, e.g. /src)
|
||||
PROJECT_ROOT = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "..", "..")
|
||||
)
|
||||
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
CONFIG_PATH = os.path.join(PROJECT_ROOT, "config", "config.yaml")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user