clan-cli: Add passthru.sourceWithTest for container_test.py

This commit is contained in:
Qubasa
2025-10-22 14:36:16 +02:00
parent 9851993b82
commit 841e9135fe
2 changed files with 2 additions and 2 deletions

View File

@@ -62,6 +62,6 @@ in
peer1.succeed("chmod 640 /var/log/journal/*/user-1000.journal*")
# Run tests as text-user (environment variables are set automatically)
peer1.succeed("su - text-user -c 'pytest -s -n0 ${cli}/${cli.pythonRuntime.sitePackages}/clan_lib/service_runner'")
peer1.succeed("su - text-user -c 'pytest -p no:cacheprovider -o addopts="" -s -n0 ${cli.passthru.sourceWithTests}/clan_lib/service_runner'")
'';
}

View File

@@ -103,7 +103,6 @@ let
_root: path: _type:
(builtins.match ".*/test_[^/]+\.py" path) != null # matches test_*.py
&& (builtins.match ".*/[^/]+_test\.py" path) != null # matches *_test.py
&& (builtins.match ".*/container_test\.py" path) == null # doesn't match container_test.py
)
];
}
@@ -301,6 +300,7 @@ pythonRuntime.pkgs.buildPythonApplication {
passthru.runtimeDependenciesMap = bundledRuntimeDependenciesMap;
passthru.testRuntimeDependencies = testRuntimeDependencies;
passthru.testRuntimeDependenciesMap = testRuntimeDependenciesMap;
passthru.sourceWithTests = sourceWithTests;
# Nixpkgs doesn't get copied from `src` as it's not in `package-data` in `pyproject.toml`
# as it significantly slows down the build so we copy it again here