seaweedfs: add version check passthru.tests

passthru.tests instead of installCheckPhase as recommended in
https://github.com/ryantm/nixpkgs-update/issues/260#issuecomment-821287971

Inspired by
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/science/logic/key/default.nix#L54-L57

This is basically the extent of testing I usually do when an upgrade
is proposed, so this takes that manual step away.
This commit is contained in:
Arnout Engelen 2021-04-16 17:49:23 +02:00 committed by tomberek
parent 267761cf44
commit e424c9118b

View File

@ -1,4 +1,9 @@
{ lib, fetchFromGitHub, buildGoModule }: { lib
, fetchFromGitHub
, buildGoModule
, runCommand
, seaweedfs
}:
buildGoModule rec { buildGoModule rec {
pname = "seaweedfs"; pname = "seaweedfs";
@ -15,6 +20,11 @@ buildGoModule rec {
subPackages = [ "weed" ]; subPackages = [ "weed" ];
passthru.tests.check-version = runCommand "weed-version" { meta.timeout = 3; } ''
${seaweedfs}/bin/weed version | grep -Fw ${version}
touch $out
'';
meta = with lib; { meta = with lib; {
description = "Simple and highly scalable distributed file system"; description = "Simple and highly scalable distributed file system";
homepage = "https://github.com/chrislusf/seaweedfs"; homepage = "https://github.com/chrislusf/seaweedfs";