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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user