[PATCH] [core-updates-frozen] gnu: ledger: Remove failing test output.

  • Done
  • quality assurance status badge
Details
2 participants
  • Guillaume Le Vaillant
  • John Kehayias
Owner
unassigned
Submitted by
John Kehayias
Severity
normal

Debbugs page

John Kehayias wrote 3 years ago
(name . Guix-patches)(address . guix-patches@gnu.org)
DbIKi7rOz5d9q96LfLMVQCTfb5fK-MSOs8GH9FC8DiJHahOjK-7r2NWlP5ioCqoHujEw0w2bUQG3sYw8_s-GZYFCyyxZZZvW4mf2m_bxYYA=@protonmail.com
Hello,

I'm not sure why, but ledger started failing one of its test on core-updates-frozen. The test is for the error when trying to use a nonexistent file (as far as I can tell) and it fails in the error message reporting the path of the file without the leading "./". Output of the test below. The patch removes this test from ledger.

359/396 Test #359: RegressTest_BF3C1F82-2 ................................***Failed 0.04 sec
FAILURE in error output from /tmp/guix-build-ledger-3.2.1.drv-0/source/test/regress/BF3C1F82-2.test:
--
$ledger -f - reg
--
@@ -1,2 +1,2 @@

While parsing file "", line 2:

-Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"

+Error: File to include was not found: "non-existent-ledger-file-BF3C1F82"

E[BF3C1F82-2.test]STDERR:
b''
FAILURE in error output from /tmp/guix-build-ledger-3.2.1.drv-0/source/test/regress/BF3C1F82-2.test:
--
$ledger -f /dev/stdin reg
--
@@ -1,2 +1,2 @@

While parsing file "", line 2:

-Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"

+Error: File to include was not found: "non-existent-ledger-file-BF3C1F82"

E[BF3C1F82-2.test]STDERR:
b''

FAILED (2)

Thanks,
John
From 279743a20221fb9e3454da889500515d6a2ef785 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Fri, 19 Nov 2021 17:38:51 -0500
Subject: [PATCH] gnu: ledger: Remove failing test output.

Removes a test which doesn't have output matching the expected (it misses the
leading "./").

* gnu/packages/finance.scm (php)[source]: Add patch.
* gnu/packages/patches/ledger-remove-test.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/finance.scm | 4 ++-
gnu/packages/patches/ledger-remove-test.patch | 28 +++++++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/ledger-remove-test.patch

Toggle diff (70 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index d4a6b59e34..4931103ac6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1328,6 +1328,7 @@ dist_patch_DATA = \
%D%/packages/patches/lcalc-lcommon-h.patch \
%D%/packages/patches/lcalc-using-namespace-std.patch \
%D%/packages/patches/ldns-drill-examples.patch \
+ %D%/packages/patches/ledger-remove-test.patch \
%D%/packages/patches/leela-zero-gtest.patch \
%D%/packages/patches/less-hurd-path-max.patch \
%D%/packages/patches/liba52-enable-pic.patch \
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index b6c6527aa0..322462a0c5 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -25,6 +25,7 @@
;;; Copyright © 2021 ZmnSCPxj jxPCSnmZ <ZmnSCPxj@protonmail.com>
;;; Copyright © 2021 François J <francois-oss@avalenn.eu>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -305,7 +306,8 @@ (define-public ledger
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"))))
+ (base32 "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"))
+ (patches (search-patches "ledger-remove-test.patch"))))
(build-system cmake-build-system)
(arguments
`(#:modules (,@%cmake-build-system-modules
diff --git a/gnu/packages/patches/ledger-remove-test.patch b/gnu/packages/patches/ledger-remove-test.patch
new file mode 100644
index 0000000000..636784c3ac
--- /dev/null
+++ b/gnu/packages/patches/ledger-remove-test.patch
@@ -0,0 +1,28 @@
+This test started failing on core-updates-frozen sometime after this commit:
+
+https://git.savannah.gnu.org/cgit/guix.git/log/?id=727f05e1e285aa52f5a19ec923fdc2259859b4b1
+
+It reports the wrong error message, with a lack of a leading "./" in the file name. So it
+passes in that it correctly errors on the missing file, but has the wrong output. This
+patch removes the test file to ignore the test.
+
+diff --git a/test/regress/BF3C1F82-2.test b/test/regress/BF3C1F82-2.test
+deleted file mode 100644
+index a7808504..00000000
+--- a/test/regress/BF3C1F82-2.test
++++ /dev/null
+@@ -1,14 +0,0 @@
+-; Check that include directives are relative for "-f /dev/stdin"
+-include non-existent-ledger-file-BF3C1F82
+-
+-test -f - reg -> 1
+-__ERROR__
+-While parsing file "", line 2:
+-Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"
+-end test
+-
+-test -f /dev/stdin reg -> 1
+-__ERROR__
+-While parsing file "", line 2:
+-Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"
+-end test
--
2.33.1
Guillaume Le Vaillant wrote 3 years ago
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 51987@debbugs.gnu.org)
87k0h3xjnp.fsf@kitej
John Kehayias via Guix-patches via <guix-patches@gnu.org> skribis:

Toggle quote (23 lines)
> Hello,
>
> I'm not sure why, but ledger started failing one of its test on core-updates-frozen. The test is for the error when trying to use a nonexistent file (as far as I can tell) and it fails in the error message reporting the path of the file without the leading "./". Output of the test below. The patch removes this test from ledger.
>
> 359/396 Test #359: RegressTest_BF3C1F82-2 ................................***Failed 0.04 sec
> FAILURE in error output from /tmp/guix-build-ledger-3.2.1.drv-0/source/test/regress/BF3C1F82-2.test:
> --
> $ledger -f - reg
> --
> @@ -1,2 +1,2 @@
>
> While parsing file "", line 2:
>
> -Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82"
>
> +Error: File to include was not found: "non-existent-ledger-file-BF3C1F82"
>
> E[BF3C1F82-2.test]STDERR:
> b''
> FAILURE in error output from /tmp/guix-build-ledger-3.2.1.drv-0/source/test/regress/BF3C1F82-2.test:
> --
> $ledger -f /dev/stdin reg

Hi,

Instead of adding a patch removing the file, wouldn't it be simpler to just add a phase
calling '(delete-file "test/...")'?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZi/Og8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+q8AD+KBX6OAJzs2WoVLa2rxRECInZczhCz06LVHHz
7IJHT2AA/R0cR2kpQd3TR4DHF2iJmQaqUkaHyhCtKsB0xEFQ98c8
=ucye
-----END PGP SIGNATURE-----

John Kehayias wrote 3 years ago
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 51987@debbugs.gnu.org)
f6nBMBeLWxV8BA90ZdT42NLpOgLVbKcfozVlemi9jvFolsOQc_IHo_i5GwOKRibgQCiqvMMvL1IFmaqxk-zJnYVIr435fdNgWSxEL-z97YY=@protonmail.com
Hello,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, November 20th, 2021 at 4:19 AM, Guillaume Le Vaillant wrote:

Toggle quote (3 lines)
> Instead of adding a patch removing the file, wouldn't it be simpler to just add a phase
> calling '(delete-file "test/...")'?

That's a very good point, much easier! I've attached v2 of the patch (commit message also had a typo before) where I used a snippet to remove the file. I haven't written a snippet before but seemed like a clean and explicit way to do the source modification here.

Hope that's better!

John
From 49cfab2b6c52bd0be59f17f9bbcd669937beb2a6 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Sat, 20 Nov 2021 13:02:25 -0500
Subject: [PATCH V2] gnu: ledger: Remove failing test output.

* gnu/packages/finance.scm (ledger)[source]: Add snippet to remove a failing test.
---
gnu/packages/finance.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 354a2f2e0f..0c045b7bd3 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -25,6 +25,7 @@
;;; Copyright © 2021 ZmnSCPxj jxPCSnmZ <ZmnSCPxj@protonmail.com>
;;; Copyright © 2021 François J <francois-oss@avalenn.eu>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -304,7 +305,14 @@ (define-public ledger
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"))))
+ (base32 "0x6jxwss3wwzbzlwmnwb8yzjk8f9wfawif4f1b74z2qg6hc4r7f6"))
+ (snippet '(begin
+ ;; Remove test that fails due to difference in
+ ;; reported error message (missing leading "./" in the
+ ;; file name); started some time after Guix commit
+ ;; 727f05e1e285aa52f5a19ec923fdc2259859b4b1
+ (delete-file "test/regress/BF3C1F82-2.test")
+ #true))))
(build-system cmake-build-system)
(arguments
`(#:modules (,@%cmake-build-system-modules
--
2.33.1
Guillaume Le Vaillant wrote 3 years ago
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 51987-done@debbugs.gnu.org)
87pmqu7kdy.fsf@kitej
Patch pushed as c51667d52ed40b70cd15ff890141bff98f5e0d9a.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYZk+CQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j/C7QEAmqzul38REyWju6B+bL8tVLuen1q/XBTpdKf/
EMPDzWoA/1qHpePt0br8mGN8l8zT0ikoNMYhcQ4rWZCoM4r5OAXX
=53+7
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 51987@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51987
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help