Skip to content

Commit

Permalink
seaweedfs: add version check passthru.tests
Browse files Browse the repository at this point in the history
passthru.tests instead of installCheckPhase as recommended in
nix-community/nixpkgs-update#260 (comment)

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.
  • Loading branch information
raboof authored and tomberek committed Apr 28, 2021
1 parent 267761c commit e424c91
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkgs/applications/networking/seaweedfs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ lib, fetchFromGitHub, buildGoModule }:
{ lib
, fetchFromGitHub
, buildGoModule
, runCommand
, seaweedfs
}:

buildGoModule rec {
pname = "seaweedfs";
Expand All @@ -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";
Expand Down

0 comments on commit e424c91

Please sign in to comment.