From fedb4d5ead8b3909133e2763f936b1bbf9305322 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 17 Feb 2026 23:09:18 +0100 Subject: [PATCH] testing: migrate flakes/inputs.sh Change-Id: I4446441cb7eea51a42f055f042cceb3e63b84b92 --- tests/functional/flakes/inputs.sh | 80 ------------------------- tests/functional/meson.build | 1 - tests/functional2/flakes/test_inputs.py | 58 ++++++++++++++++++ 3 files changed, 58 insertions(+), 81 deletions(-) delete mode 100644 tests/functional/flakes/inputs.sh create mode 100644 tests/functional2/flakes/test_inputs.py diff --git a/tests/functional/flakes/inputs.sh b/tests/functional/flakes/inputs.sh deleted file mode 100644 index 80620488a..000000000 --- a/tests/functional/flakes/inputs.sh +++ /dev/null @@ -1,80 +0,0 @@ -source ./common.sh - -requireGit - - -test_subdir_self_path() { - baseDir=$TEST_ROOT/$RANDOM - flakeDir=$baseDir/b-low - mkdir -p $flakeDir - writeSimpleFlake $baseDir - writeSimpleFlake $flakeDir - - echo all good > $flakeDir/message - cat > $flakeDir/flake.nix < $flakeDir/message - cat > $flakeDir/flake.nix < $clientDir/flake.nix < PATH=" in nix.nix(["build", f"{files}/b-low", "--no-link"]).run().ok().stderr_s + + +@with_files({"repo": files | get_global_asset_pack(".git"), "client": {}}) +def test_git_subdir_self_path(nix: Nix, files: Path, git: Git): + repo_dir = files / "repo" + git(repo_dir, "add", ".") + git(repo_dir, "commit", "-m", "init") + + client_dir = files / "client" + (client_dir / "flake.nix").write_text(f"""{{ + inputs.inp = {{ + type = "git"; + url = "file://{repo_dir}"; + dir = "b-low"; + }}; + + outputs = inputs: rec {{ + packages = inputs.inp.packages; + }}; + }}""") + + assert "simple> PATH=" in nix.nix(["build", client_dir, "--no-link"]).run().ok().stderr_s