gitbatch: Fix tests requiring .git & writable HOME

Disable the tests requiring access to gitlab.com

Bug fixed by #173702 runs the previously skipped tests for this
package.
This commit is contained in:
Berk D. Demir 2022-05-01 23:15:08 +00:00
parent aee4df7eeb
commit a3205db0c5

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }: { lib, buildGoModule, fetchFromGitHub, git }:
buildGoModule rec { buildGoModule rec {
pname = "gitbatch"; pname = "gitbatch";
@ -15,7 +15,15 @@ buildGoModule rec {
ldflags = [ "-s" "-w" ]; ldflags = [ "-s" "-w" ];
checkFlags = [ "-short" ]; nativeBuildInputs = [
git # required by unit tests
];
preCheck = ''
HOME=$(mktemp -d)
# Disable tests requiring network access to gitlab.com
buildFlagsArray+=("-run" "[^(Test(Run|Start|(Fetch|Pull)With(Go|)Git))]")
'';
meta = with lib; { meta = with lib; {
description = "Running git UI commands"; description = "Running git UI commands";