unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#27938] [PATCH] gnu: git: Enable tests.
@ 2017-08-03 21:07 Marius Bakke
  2017-08-03 22:15 ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Marius Bakke @ 2017-08-03 21:07 UTC (permalink / raw)
  To: 27938

* gnu/packages/version-control.scm (git)[arguments]: Remove #:tests?. Add
'patch-tests' phase.
---
 gnu/packages/version-control.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 9274a93f6..99b3dbc4e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -176,7 +176,6 @@ as well as the classic centralized workflow.")
                      ;; nars; see <https://bugs.gnu.org/21949>.
                      "NO_INSTALL_HARDLINKS=indeed")
       #:test-target "test"
-      #:tests? #f ; FIXME: Many tests are failing
 
       ;; The explicit --with-tcltk forces the build system to hardcode the
       ;; absolute file name to 'wish'.
@@ -203,6 +202,37 @@ as well as the classic centralized workflow.")
             ;; Add the "PM.stamp" to avoid "no rule to make target".
             (call-with-output-file "perl/PM.stamp" (const #t))
             #t))
+        (add-before 'check 'patch-tests
+          (lambda _
+            ;; These files contain some funny bytes that Guile is unable
+            ;; to decode for shebang patching. Just delete them.
+            (for-each delete-file '("t/t4201-shortlog.sh"
+                                    "t/t7813-grep-icase-iso.sh"))
+            ;; Many tests contain inline shell scripts (hooks etc).
+            (substitute* (find-files "t" "\\.sh$")
+              (("#!/bin/sh") (string-append "#!" (which "sh"))))
+            ;; Un-do shebang patching here to prevent checksum mismatch.
+            (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
+              (("^#!.*/bin/perl") "#!/usr/bin/perl"))
+            (substitute* "t/t5003-archive-zip.sh"
+              (("cp /bin/sh") (string-append "cp " (which "sh"))))
+            (substitute* "t/t6030-bisect-porcelain.sh"
+              (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
+            ;; FIXME: This test runs `git commit` with a bogus EDITOR
+            ;; and empty commit message, but does not fail the way it's
+            ;; expected to. The test passes when invoked interactively.
+            (substitute* "t/t7508-status.sh"
+              (("\tcommit_template_commented") "\ttrue"))
+            ;; More checksum mismatches due to odd shebangs.
+            (substitute* "t/t9100-git-svn-basic.sh"
+              (("\"#!/gnu.*/bin/sh") "\"#!/bin/sh"))
+            (substitute* "t/t9300-fast-import.sh"
+              (("\t#!/gnu.*/bin/sh") "\t#!/bin/sh")
+              (("'#!/gnu.*/bin/sh") "'#!/bin/sh"))
+            ;; FIXME: Some hooks fail with "basename: command not found".
+            ;; See 't/trash directory.t9164.../svn-hook.log'.
+            (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
+            #t))
         (add-after 'install 'install-shell-completion
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out         (assoc-ref outputs "out"))
-- 
2.13.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#27938] [PATCH] gnu: git: Enable tests.
  2017-08-03 21:07 [bug#27938] [PATCH] gnu: git: Enable tests Marius Bakke
@ 2017-08-03 22:15 ` Leo Famulari
  2017-08-03 23:35   ` bug#27938: " Marius Bakke
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2017-08-03 22:15 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 27938

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

On Thu, Aug 03, 2017 at 11:07:30PM +0200, Marius Bakke wrote:
> * gnu/packages/version-control.scm (git)[arguments]: Remove #:tests?. Add
> 'patch-tests' phase.

Wow, awesome! LGTM.

> +            ;; Un-do shebang patching here to prevent checksum mismatch.
> +            (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
> +              (("^#!.*/bin/perl") "#!/usr/bin/perl"))

I've been thinking, we should have a way to pass a list of directories
or files to exclude from the shebang patcher. We have a few packages
that include files where patching the shebang is the wrong thing to do.
For example, the Git example hook scripts.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#27938: [PATCH] gnu: git: Enable tests.
  2017-08-03 22:15 ` Leo Famulari
@ 2017-08-03 23:35   ` Marius Bakke
  0 siblings, 0 replies; 3+ messages in thread
From: Marius Bakke @ 2017-08-03 23:35 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 27938-done

[-- Attachment #1: Type: text/plain, Size: 897 bytes --]

Leo Famulari <leo@famulari.name> writes:

> On Thu, Aug 03, 2017 at 11:07:30PM +0200, Marius Bakke wrote:
>> * gnu/packages/version-control.scm (git)[arguments]: Remove #:tests?. Add
>> 'patch-tests' phase.
>
> Wow, awesome! LGTM.

Thanks for the fast review! Pushed in c9f4f56b24801718d89c2520bec08867516e1371.

>
>> +            ;; Un-do shebang patching here to prevent checksum mismatch.
>> +            (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
>> +              (("^#!.*/bin/perl") "#!/usr/bin/perl"))
>
> I've been thinking, we should have a way to pass a list of directories
> or files to exclude from the shebang patcher. We have a few packages
> that include files where patching the shebang is the wrong thing to do.
> For example, the Git example hook scripts.

That would be nice. I guess we can experiment with overriding the
various patching phases and see what works.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-03 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 21:07 [bug#27938] [PATCH] gnu: git: Enable tests Marius Bakke
2017-08-03 22:15 ` Leo Famulari
2017-08-03 23:35   ` bug#27938: " Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).