From b419a39f1f3283264ee63845cdcd526db10facae Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Tue, 23 May 2023 13:39:42 +0300 Subject: [PATCH] hercules-ci-agent: replace help test with a better version test --- .../hercules-ci-agent/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix index d655941e7a27..c5c52d29d3aa 100644 --- a/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix +++ b/pkgs/development/tools/continuous-integration/hercules-ci-agent/default.nix @@ -9,8 +9,8 @@ nixos, openssh, runc, - runCommand, stdenv, + testers, }: let inherit (haskell.lib.compose) overrideCabal addBuildTools justStaticExecutables; @@ -34,13 +34,11 @@ in pkg.overrideAttrs (finalAttrs: o: { position = toString ./default.nix + ":1"; }; passthru = o.passthru // { - tests = { - help = runCommand "test-hercules-ci-agent-help" { } '' - (${finalAttrs.finalPackage}/bin/hercules-ci-agent --help 2>&1 || true) | grep -F -- '--config' - (${lib.getExe finalAttrs.finalPackage} --help 2>&1 || true) | grep -F -- '--config' - touch $out - ''; + version = testers.testVersion { + package = finalAttrs.finalPackage; + command = "hercules-ci-agent --help"; + }; } // lib.optionalAttrs (stdenv.isLinux) { # Does not test the package, but evaluation of the related NixOS module. nixos-simple-config = (nixos {