From 1b748f081ad7ef034ce6c7438305d9957e771aec Mon Sep 17 00:00:00 2001 From: "Berk D. Demir" Date: Sun, 1 May 2022 23:15:08 +0000 Subject: skeema: Disable tests requiring network & fix deps - Disable the tests requiring access to gitlab.com. - Add coreutils to `nativeBuildInputs` for printf and echo binaries. - Fix hard coded paths to coreutils binaries. Bug fixed by #173702 runs the previously skipped tests for this package. --- pkgs/tools/system/skeema/default.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'pkgs/tools/system/skeema') diff --git a/pkgs/tools/system/skeema/default.nix b/pkgs/tools/system/skeema/default.nix index bf1bacede8d07..4d39e47da5912 100644 --- a/pkgs/tools/system/skeema/default.nix +++ b/pkgs/tools/system/skeema/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, coreutils }: buildGoModule rec { pname = "skeema"; @@ -17,6 +17,29 @@ buildGoModule rec { ldflags = [ "-s" "-w" ]; + preCheck = '' + # Disable tests requiring network access to gitlab.com + buildFlagsArray+=("-run" "[^(Test(ParseDir(Symlinks|))|DirRelPath)]") + + # Fix tests expecting /usr/bin/printf and /bin/echo + substituteInPlace skeema_cmd_test.go \ + --replace /usr/bin/printf "${coreutils}/bin/printf" + + substituteInPlace internal/fs/dir_test.go \ + --replace /bin/echo "${coreutils}/bin/echo" \ + --replace /usr/bin/printf "${coreutils}/bin/printf" + + substituteInPlace internal/applier/ddlstatement_test.go \ + --replace /bin/echo "${coreutils}/bin/echo" + + substituteInPlace internal/util/shellout_unix_test.go \ + --replace /bin/echo "${coreutils}/bin/echo" \ + --replace /usr/bin/printf "${coreutils}/bin/printf" + + substituteInPlace internal/util/shellout_unix_test.go \ + --replace /bin/echo "${coreutils}/bin/echo" + ''; + checkFlags = [ "-short" ]; meta = with lib; { -- cgit 1.4.1