hub: Add test

This commit is contained in:
Tim Steinbach 2020-12-29 11:13:26 -05:00 committed by Tim Steinbach
parent 0576111e8a
commit 4c9414d31c
3 changed files with 21 additions and 1 deletions

View File

@ -158,6 +158,7 @@ in
home-assistant = handleTest ./home-assistant.nix {};
hostname = handleTest ./hostname.nix {};
hound = handleTest ./hound.nix {};
hub = handleTest ./git/hub.nix {};
hydra = handleTest ./hydra {};
i3wm = handleTest ./i3wm.nix {};
icingaweb2 = handleTest ./icingaweb2.nix {};

17
nixos/tests/git/hub.nix Normal file
View File

@ -0,0 +1,17 @@
import ../make-test-python.nix ({ pkgs, ...} : {
name = "hub";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
};
nodes.hub = { pkgs, ... }:
{
environment.systemPackages = [ pkgs.gitAndTools.hub ];
};
testScript =
''
assert "git version ${pkgs.git.version}\nhub version ${pkgs.gitAndTools.hub.version}\n" in hub.succeed("hub version")
assert "These GitHub commands are provided by hub" in hub.succeed("hub help")
'';
})

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoPackage, fetchFromGitHub, git, groff, installShellFiles, util-linux }:
{ stdenv, buildGoPackage, fetchFromGitHub, git, groff, installShellFiles, util-linux, nixosTests }:
buildGoPackage rec {
pname = "hub";
@ -35,6 +35,8 @@ buildGoPackage rec {
installManPage share/man/man[1-9]/*.[1-9]
'';
passthru.tests = { inherit (nixosTests) hub; };
meta = with stdenv.lib; {
description = "Command-line wrapper for git that makes you better at GitHub";
license = licenses.mit;