From e424c9118bbc05a82c13ae252f7808ffb6a65a8b Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 16 Apr 2021 17:49:23 +0200 Subject: [PATCH] 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. --- pkgs/applications/networking/seaweedfs/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/seaweedfs/default.nix b/pkgs/applications/networking/seaweedfs/default.nix index 23d2d498d6c..61f318009f7 100644 --- a/pkgs/applications/networking/seaweedfs/default.nix +++ b/pkgs/applications/networking/seaweedfs/default.nix @@ -1,4 +1,9 @@ -{ lib, fetchFromGitHub, buildGoModule }: +{ lib +, fetchFromGitHub +, buildGoModule +, runCommand +, seaweedfs +}: buildGoModule rec { pname = "seaweedfs"; @@ -15,6 +20,11 @@ buildGoModule rec { subPackages = [ "weed" ]; + passthru.tests.check-version = runCommand "weed-version" { meta.timeout = 3; } '' + ${seaweedfs}/bin/weed version | grep -Fw ${version} + touch $out + ''; + meta = with lib; { description = "Simple and highly scalable distributed file system"; homepage = "https://github.com/chrislusf/seaweedfs";