about summary refs log tree commit diff
path: root/pkgs/tools/system/skeema/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/skeema/default.nix')
-rw-r--r--pkgs/tools/system/skeema/default.nix35
1 files changed, 19 insertions, 16 deletions
diff --git a/pkgs/tools/system/skeema/default.nix b/pkgs/tools/system/skeema/default.nix
index 68d1a1c627b39..a7503baac14b5 100644
--- a/pkgs/tools/system/skeema/default.nix
+++ b/pkgs/tools/system/skeema/default.nix
@@ -17,32 +17,35 @@ buildGoModule rec {
 
   ldflags = [ "-s" "-w" ];
 
-  preCheck =
+  preCheck = ''
+    # 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"
+  '';
+
+  checkFlags =
     let
       skippedTests = [
         # Tests requiring network access to gitlab.com
         "TestDirRelPath"
-        "TestParseDirSymlinks"
+        "TestParseDir"
 
         # Flaky tests
         "TestCommandTimeout"
         "TestShellOutTimeout"
+
+        # Fails with 'internal/fs/testdata/cfgsymlinks1/validrel/.skeema is a symlink pointing outside of its repo'.
+        "TestParseDirSymlinks"
       ];
     in
-    ''
-      buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
-
-      # 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"
-    '';
+    [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
 
   passthru.tests.version = testers.testVersion {
     package = skeema;