[PATCH] tests: lint: Add origin patch file name test cases.

  • Done
  • quality assurance status badge
Details
2 participants
  • Chris Marusich
  • Ludovic Courtès
Owner
unassigned
Submitted by
Chris Marusich
Severity
normal
C
C
Chris Marusich wrote on 14 Jun 2020 07:34
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . guix-patches@gnu.org)
878sgqi52k.fsf@gmail.com
Hi Ludo and others,

Here's a patch to add some missing lint test cases. I confirmed that
all the lint tests pass. I also confirmed that the new "<origin>
patches: same file name -> no warnings" test case fails (as expected)
when commit 21887021b9acf60157b1b0a39c16f2ec6498021b is reverted, so the
new tests do seem to be working as intended.

Thank you for encouraging me to add these test cases, Ludo!

--
Chris
From 5fa2156f8561afb87d7f9a63de0243334e9da53b Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
Date: Sat, 13 Jun 2020 22:09:46 -0700
Subject: [PATCH] tests: lint: Add origin patch file name test cases.

In particular, "<origin> patches: same file name -> no warnings" would
have caught the issue which was fixed in commit
21887021b9acf60157b1b0a39c16f2ec6498021b.

* tests/lint.scm (patches: file names): Rename this test case...
("file patches: different file name -> warning"): ... to this.
("file patches: same file name -> no warnings")
("<origin> patches: different file name -> warning")
("<origin> patches: same file name -> no warnings"): New test cases.
---
tests/lint.scm | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)

Toggle diff (53 lines)
diff --git a/tests/lint.scm b/tests/lint.scm
index 4ce45b4a70..53647373e4 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -310,7 +310,7 @@
`(("python-setuptools" ,python-setuptools))))))
(check-inputs-should-not-be-an-input-at-all pkg))))
-(test-equal "patches: file names"
+(test-equal "file patches: different file name -> warning"
"file names of patches should start with the package name"
(single-lint-warning-message
(let ((pkg (dummy-package "x"
@@ -319,6 +319,37 @@
(patches (list "/path/to/y.patch")))))))
(check-patch-file-names pkg))))
+(test-equal "file patches: same file name -> no warnings"
+ '()
+ (let ((pkg (dummy-package "x"
+ (source
+ (dummy-origin
+ (patches (list "/path/to/x.patch")))))))
+ (check-patch-file-names pkg)))
+
+(test-equal "<origin> patches: different file name -> warning"
+ "file names of patches should start with the package name"
+ (single-lint-warning-message
+ (let ((pkg (dummy-package "x"
+ (source
+ (dummy-origin
+ (patches
+ (list
+ (dummy-origin
+ (file-name "y.patch")))))))))
+ (check-patch-file-names pkg))))
+
+(test-equal "<origin> patches: same file name -> no warnings"
+ '()
+ (let ((pkg (dummy-package "x"
+ (source
+ (dummy-origin
+ (patches
+ (list
+ (dummy-origin
+ (file-name "x.patch")))))))))
+ (check-patch-file-names pkg)))
+
(test-equal "patches: file name too long"
(string-append "x-"
(make-string 100 #\a)
--
2.26.2
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAl7lttMACgkQ3UCaFdgi
Rp3DHxAAwSArK23xbQ9rwYPw0ZHbVksMPBjj/34+VTqFR3bd0h5OzgZqFh8LpX53
pfN+uHMcD8S7E4cM89YixMWHtDjp1B1LHuLadesAWCP/KJGRwxTYVxqedOT8J/qB
mb6A+/sIzcc2s1s7k2GJcn4ryYkGaLllsZAVuc2MqaMikcBBs22KWolXLqCX3QzT
13NpJgnYnsJJKpJ1G06hjVUPr3rtOGHysTBuCKKD/ePhEqXR1zT+Uliaelg+tqIk
XP+Yy3uU0IcW+Mqp+U89qJa0jwhPeaOMyOzLsBa80USPJJV6vsmMv2ium46b87YF
fYxIqwEyidngz7ulbmdQHx6qtERxckCTEs+qEqzYu0nshlaT5x4L6bK7oenvuxc5
yMF+zwFqNVh9r2bYtjOoTLd5FmjuorGDIy4V2f5h2Os4J18MCMzw2NBWB2DXTLZ0
L8iYArA2WQHLDFDli7qUx8abp88PDBGyzpokvFoq7EdjsgyxofUtMDie6M2cBeCn
mNvIl1QxT8moIdqcCIXD/AAQQ94yCgPLeOpQBcIvlTbgYXRkOc9rAF9jN9GSipjx
Jyr6bXARkX4M87VbkkvEY/Ee3jkgJcObtZG4aSCxKVUvSu6Px3Y+PKIZzvgtqHNz
NuoMYJkvZkn/uK8OJyVj5+QWFZEQM6ZAN/iTIlHlIDiZ2mmTxyU=
=0RPr
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 14 Jun 2020 22:45
(name . Chris Marusich)(address . cmmarusich@gmail.com)(address . 41845@debbugs.gnu.org)
871rmhtm0a.fsf@gnu.org
Hi Chris,

Chris Marusich <cmmarusich@gmail.com> skribis:

Toggle quote (15 lines)
> From 5fa2156f8561afb87d7f9a63de0243334e9da53b Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich@gmail.com>
> Date: Sat, 13 Jun 2020 22:09:46 -0700
> Subject: [PATCH] tests: lint: Add origin patch file name test cases.
>
> In particular, "<origin> patches: same file name -> no warnings" would
> have caught the issue which was fixed in commit
> 21887021b9acf60157b1b0a39c16f2ec6498021b.
>
> * tests/lint.scm (patches: file names): Rename this test case...
> ("file patches: different file name -> warning"): ... to this.
> ("file patches: same file name -> no warnings")
> ("<origin> patches: different file name -> warning")
> ("<origin> patches: same file name -> no warnings"): New test cases.

LGTM. Thanks for taking the time to write these tests!

Ludo’.
L
L
Ludovic Courtès wrote on 7 Dec 2020 12:50
(name . Chris Marusich)(address . cmmarusich@gmail.com)(address . 41845-done@debbugs.gnu.org)
87wnxtzvfs.fsf@gnu.org
Hi Chris,

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (19 lines)
> Chris Marusich <cmmarusich@gmail.com> skribis:
>
>> From 5fa2156f8561afb87d7f9a63de0243334e9da53b Mon Sep 17 00:00:00 2001
>> From: Chris Marusich <cmmarusich@gmail.com>
>> Date: Sat, 13 Jun 2020 22:09:46 -0700
>> Subject: [PATCH] tests: lint: Add origin patch file name test cases.
>>
>> In particular, "<origin> patches: same file name -> no warnings" would
>> have caught the issue which was fixed in commit
>> 21887021b9acf60157b1b0a39c16f2ec6498021b.
>>
>> * tests/lint.scm (patches: file names): Rename this test case...
>> ("file patches: different file name -> warning"): ... to this.
>> ("file patches: same file name -> no warnings")
>> ("<origin> patches: different file name -> warning")
>> ("<origin> patches: same file name -> no warnings"): New test cases.
>
> LGTM. Thanks for taking the time to write these tests!

I went ahead and pushed it as d8ae7852057d5c1818c9c8bb77e8c41407a0d985.

Thanks,
Ludo’.
Closed
?