[PATCH] lint: Check for more types of custom 'check phases.

  • Done
  • quality assurance status badge
Details
3 participants
  • Dariqq
  • Ludovic Courtès
  • Simon Tournier
Owner
unassigned
Submitted by
Dariqq
Severity
normal
D
D
Dariqq wrote on 6 Nov 11:46 +0100
(address . guix-patches@gnu.org)(name . Dariqq)(address . dariqq@posteo.net)
705438b285d013ee05c5ae1d73b1c80aff2aa4fa.1730890007.git.dariqq@posteo.net
* guix/lint.scm (check-optional-tests): Also check for add-before and
add-after when adding custom 'check phases.

Change-Id: Idc959f90d7e9aa9d5001f34e00f88b41aa20fb2a
---
Hi,
Stumbled upon a test failure in u-boot-utils today which is not using #:tests? for its custom 'check phase but not being detected by the linter. Reason is that the 'check phase is added after 'install and not just replacing it.

This little patch makes it it possible to detect it and adds 38 more warnings.


guix/lint.scm | 4 ++++
1 file changed, 4 insertions(+)

Toggle diff (19 lines)
diff --git a/guix/lint.scm b/guix/lint.scm
index 8c6c20c723..4ba728da33 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -1433,6 +1433,10 @@ (define (check-optional-tests package)
(match delta
(`(replace 'check ,expression)
(check-check-procedure expression))
+ (`(add-after ,_ 'check ,expression)
+ (check-check-procedure expression))
+ (`(add-before ,_ 'check ,expression)
+ (check-check-procedure expression))
(_ '())))
(define (check-phases-deltas deltas)
(append-map check-phases-delta deltas))

base-commit: 0c1a6db8094dc6b20762eceae369daae545fc5e4
--
2.46.0
S
S
Simon Tournier wrote on 16 Nov 09:07 +0100
87ed3bbnz9.fsf@gmail.com
Hi,

On Wed, 06 Nov 2024 at 10:46, Dariqq <dariqq@posteo.net> wrote:

Toggle quote (13 lines)
> diff --git a/guix/lint.scm b/guix/lint.scm
> index 8c6c20c723..4ba728da33 100644
> --- a/guix/lint.scm
> +++ b/guix/lint.scm
> @@ -1433,6 +1433,10 @@ (define (check-optional-tests package)
> (match delta
> (`(replace 'check ,expression)
> (check-check-procedure expression))
> + (`(add-after ,_ 'check ,expression)
> + (check-check-procedure expression))
> + (`(add-before ,_ 'check ,expression)
> + (check-check-procedure expression))

Please note that 'check here is up to packagers. They might pick the
symbol 'tests or 'run-check or 'adjusted-tests or 'custom-tests or
whatever else. To my knowledge, there is no real convention.

Well, I do not know.

Cheers,
simon
D
D
Dariqq wrote on 19 Nov 15:32 +0100
f9a93a7a-f906-4b62-8213-996c56e1085c@posteo.net
Hi Simon,

On 16.11.24 09:07, Simon Tournier wrote:
Toggle quote (22 lines)
> Hi,
>
> On Wed, 06 Nov 2024 at 10:46, Dariqq <dariqq@posteo.net> wrote:
>
>> diff --git a/guix/lint.scm b/guix/lint.scm
>> index 8c6c20c723..4ba728da33 100644
>> --- a/guix/lint.scm
>> +++ b/guix/lint.scm
>> @@ -1433,6 +1433,10 @@ (define (check-optional-tests package)
>> (match delta
>> (`(replace 'check ,expression)
>> (check-check-procedure expression))
>> + (`(add-after ,_ 'check ,expression)
>> + (check-check-procedure expression))
>> + (`(add-before ,_ 'check ,expression)
>> + (check-check-procedure expression))
>
> Please note that 'check here is up to packagers. They might pick the
> symbol 'tests or 'run-check or 'adjusted-tests or 'custom-tests or
> whatever else. To my knowledge, there is no real convention.
>

Of course this is not perfect because the name of the phase to run the
tests is arbitrary but this (simple) change catches this problem in 38
packages currently in guix (and 'check seems to be convention in guix)

This came out of a frustration with failing tests in u-boot-tools which
implements a custom 'check phase after 'install which before
e6ec657c497cdfe9130b7bf5bdfb717a823bf02b were unskipable but passed the
lint check.



Toggle quote (5 lines)
> Well, I do not know.
>
> Cheers,
> simon

Dariqq
L
L
Ludovic Courtès wrote 7 days ago
(name . Dariqq)(address . dariqq@posteo.net)
87ldwdmfq9.fsf@gnu.org
Dariqq <dariqq@posteo.net> skribis:

Toggle quote (5 lines)
> * guix/lint.scm (check-optional-tests): Also check for add-before and
> add-after when adding custom 'check phases.
>
> Change-Id: Idc959f90d7e9aa9d5001f34e00f88b41aa20fb2a

Applied, thanks!
Closed
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 74225
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