From 32fb293e6bd6deb759c3104a2a5e5232535df594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 27 Jun 2025 18:46:45 -0700 Subject: [PATCH] calendar-cli: run tests --- pkgs/by-name/ca/calendar-cli/package.nix | 29 ++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ca/calendar-cli/package.nix b/pkgs/by-name/ca/calendar-cli/package.nix index 38c5e282c063..88af1e0efe2b 100644 --- a/pkgs/by-name/ca/calendar-cli/package.nix +++ b/pkgs/by-name/ca/calendar-cli/package.nix @@ -3,6 +3,10 @@ python3, fetchFromGitHub, nixosTests, + perl, + radicale, + which, + xandikos, }: python3.pkgs.buildPythonApplication rec { @@ -17,6 +21,13 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-w35ySLnfxXZR/a7BrPLYqXs2kqkuYhh5PcgNxJqjDtE="; }; + postPatch = '' + patchShebangs tests + substituteInPlace tests/test_calendar-cli.sh \ + --replace-fail "../bin/calendar-cli.py" "$out/bin/calendar-cli" \ + --replace-fail "../bin/calendar-cli" "$out/bin/calendar-cli" + ''; + build-system = with python3.pkgs; [ setuptools ]; @@ -31,8 +42,22 @@ python3.pkgs.buildPythonApplication rec { six ]; - # tests require networking - doCheck = false; + nativeCheckInputs = [ + perl + (python3.pkgs.toPythonModule (radicale.override { inherit python3; })) + which + xandikos + ]; + + checkPhase = '' + runHook preCheck + + pushd tests + ./test_calendar-cli.sh + popd + + runHook postCheck + ''; passthru.tests = { inherit (nixosTests) radicale;