unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41845] [PATCH] tests: lint: Add origin patch file name test cases.
@ 2020-06-14  5:34 Chris Marusich
  2020-06-14 20:45 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Marusich @ 2020-06-14  5:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 41845


[-- Attachment #1.1: Type: text/plain, Size: 429 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-tests-lint-Add-origin-patch-file-name-test-cases.patch --]
[-- Type: text/x-patch, Size: 2830 bytes --]

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(-)

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


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

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

* [bug#41845] [PATCH] tests: lint: Add origin patch file name test cases.
  2020-06-14  5:34 [bug#41845] [PATCH] tests: lint: Add origin patch file name test cases Chris Marusich
@ 2020-06-14 20:45 ` Ludovic Courtès
  2020-12-07 11:50   ` bug#41845: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2020-06-14 20:45 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 41845

Hi Chris,

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!

Ludo’.




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

* bug#41845: [PATCH] tests: lint: Add origin patch file name test cases.
  2020-06-14 20:45 ` Ludovic Courtès
@ 2020-12-07 11:50   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2020-12-07 11:50 UTC (permalink / raw)
  To: Chris Marusich; +Cc: 41845-done

Hi Chris,

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

> 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’.




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

end of thread, other threads:[~2020-12-07 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14  5:34 [bug#41845] [PATCH] tests: lint: Add origin patch file name test cases Chris Marusich
2020-06-14 20:45 ` Ludovic Courtès
2020-12-07 11:50   ` bug#41845: " Ludovic Courtès

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).