test-utilities: version test

Extract 'version test' to a reusable test utility as discussed in
https://github.com/NixOS/nixpkgs/pull/119636#issuecomment-826137021 and
This commit is contained in:
Arnout Engelen
2021-05-07 09:53:35 +02:00
parent 39e6bf7647
commit b68130fd2c
5 changed files with 57 additions and 11 deletions
@@ -1,7 +1,7 @@
{ lib
, fetchFromGitHub
, buildGoModule
, runCommand
, testVersion
, seaweedfs
}:
@@ -20,10 +20,8 @@ buildGoModule rec {
subPackages = [ "weed" ];
passthru.tests.check-version = runCommand "weed-version" { meta.timeout = 3; } ''
${seaweedfs}/bin/weed version | grep -Fw ${version}
touch $out
'';
passthru.tests.version =
testVersion { package = seaweedfs; command = "weed version"; };
meta = with lib; {
description = "Simple and highly scalable distributed file system";