Commit e424c911 authored by Arnout Engelen's avatar Arnout Engelen Committed by tomberek
Browse files

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.
parent 267761cf
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
{ 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";