GNU bug report logs - #27938
[PATCH] gnu: git: Enable tests.

Previous Next

Package: guix-patches;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Thu, 3 Aug 2017 21:08:01 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27938 in the body.
You can then email your comments to 27938 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#27938; Package guix-patches. (Thu, 03 Aug 2017 21:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marius Bakke <mbakke <at> fastmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 03 Aug 2017 21:08:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: guix-patches <at> gnu.org
Cc: Marius Bakke <mbakke <at> fastmail.com>
Subject: [PATCH] gnu: git: Enable tests.
Date: Thu,  3 Aug 2017 23:07:30 +0200
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#27938; Package guix-patches. (Thu, 03 Aug 2017 22:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 27938 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 27938 <at> debbugs.gnu.org
Subject: Re: [bug#27938] [PATCH] gnu: git: Enable tests.
Date: Thu, 3 Aug 2017 18:15:34 -0400
[Message part 1 (text/plain, inline)]
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.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Thu, 03 Aug 2017 23:36:01 GMT) Full text and rfc822 format available.

Notification sent to Marius Bakke <mbakke <at> fastmail.com>:
bug acknowledged by developer. (Thu, 03 Aug 2017 23:36:02 GMT) Full text and rfc822 format available.

Message #13 received at 27938-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Leo Famulari <leo <at> famulari.name>
Cc: 27938-done <at> debbugs.gnu.org
Subject: Re: [bug#27938] [PATCH] gnu: git: Enable tests.
Date: Fri, 04 Aug 2017 01:35:34 +0200
[Message part 1 (text/plain, inline)]
Leo Famulari <leo <at> 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.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Sep 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 352 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.