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.
commite424c9118bbc05a82c13ae252f7808ffb6a65a8b
authorArnout Engelen <arnout@bzzt.net>
dateFri 16 Apr 2021, 17:49 (6 years ago)
parent267761c
pkgs/applications/networking/seaweedfs/default.nix+11−1
@@ -1,4 +1,9 @@
1−{ lib, fetchFromGitHub, buildGoModule }:
1+{ lib
2+, fetchFromGitHub
3+, buildGoModule
4+, runCommand
5+, seaweedfs
6+}:
27
38buildGoModule rec {
49 pname = "seaweedfs";
@@ -15,6 +20,11 @@ buildGoModule rec {
1520
1621 subPackages = [ "weed" ];
1722
23+ passthru.tests.check-version = runCommand "weed-version" { meta.timeout = 3; } ''
24+ ${seaweedfs}/bin/weed version | grep -Fw ${version}
25+ touch $out
26+ '';
27+
1828 meta = with lib; {
1929 description = "Simple and highly scalable distributed file system";
2030 homepage = "https://github.com/chrislusf/seaweedfs";