clan-config: fix tests

This commit is contained in:
DavHau
2023-08-22 23:15:34 +02:00
parent 48686591d8
commit 780fd881c3
4 changed files with 43 additions and 15 deletions

View File

@@ -21,6 +21,10 @@
, rsync
}:
let
# This provides dummy options for testing clan config and prevents it from
# evaluating the flake .#
CLAN_OPTIONS_FILE = ./clan_cli/config/jsonschema/options.json;
dependencies = [ argcomplete ];
testDependencies = [
@@ -48,7 +52,7 @@ python3.pkgs.buildPythonPackage {
src = source;
format = "pyproject";
CLAN_OPTIONS_FILE = ./clan_cli/config/jsonschema/options.json;
inherit CLAN_OPTIONS_FILE;
nativeBuildInputs = [
setuptools
@@ -58,6 +62,7 @@ python3.pkgs.buildPythonPackage {
passthru.tests = {
clan-mypy = runCommand "clan-mypy" { } ''
export CLAN_OPTIONS_FILE="${CLAN_OPTIONS_FILE}"
cp -r ${source} ./src
chmod +w -R ./src
cd ./src
@@ -68,6 +73,7 @@ python3.pkgs.buildPythonPackage {
{
nativeBuildInputs = [ age zerotierone bubblewrap sops nix openssh rsync stdenv.cc ];
} ''
export CLAN_OPTIONS_FILE="${CLAN_OPTIONS_FILE}"
cp -r ${source} ./src
chmod +w -R ./src
cd ./src