From 841e9135feda033cd42c4a89b1db19afbcca2685 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Wed, 22 Oct 2025 14:36:16 +0200 Subject: [PATCH] clan-cli: Add passthru.sourceWithTest for container_test.py --- checks/systemd-abstraction/default.nix | 2 +- pkgs/clan-cli/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/systemd-abstraction/default.nix b/checks/systemd-abstraction/default.nix index 464b66c7e..4150690ad 100644 --- a/checks/systemd-abstraction/default.nix +++ b/checks/systemd-abstraction/default.nix @@ -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'") ''; } diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index bb40d5e21..cba32f69a 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -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