GNU bug report logs - #53510
[PATCH] tests: Assert that cyclic graphs can be produced.

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Mon, 24 Jan 2022 18:18:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 53510 in the body.
You can then email your comments to 53510 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#53510; Package guix-patches. (Mon, 24 Jan 2022 18:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 24 Jan 2022 18:18:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] tests: Assert that cyclic graphs can be produced.
Date: Mon, 24 Jan 2022 19:15:44 +0100
* tests/graph.scm ("package DAG, oops it was a cycle"): New test.
---
 tests/graph.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tests/graph.scm b/tests/graph.scm
index fadac265f9..baa08a6be2 100644
--- a/tests/graph.scm
+++ b/tests/graph.scm
@@ -36,6 +36,7 @@ (define-module (test-graph)
   #:use-module (gnu packages libunistring)
   #:use-module (gnu packages bootstrap)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 sandbox)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-26)
@@ -113,6 +114,33 @@ (define (edge->tuple source target)
                           (list p4 p4)
                           (list p2 p3))))))))
 
+(test-assert "package DAG, oops it was a cycle"
+  (let-values (((backend nodes+edges) (make-recording-backend)))
+    (letrec ((p1 (dummy-package "p1" (inputs `(("p3" ,p3)))))
+             (p2 (dummy-package "p2" (inputs `(("p1" ,p1)))))
+             (p3 (dummy-package "p3" (inputs `(("p2" ,p2) ("p1", p1))))))
+      (call-with-time-limit
+       600 ;; If ever this test should fail, we still want it to terminate
+       (lambda ()
+         (run-with-store %store
+           (export-graph (list p3) 'port
+                         #:node-type %package-node-type
+                         #:backend backend)))
+       (lambda ()
+         (run-with-store %store
+           (export-graph
+            (list (dummy-package "timeout-reached"))
+            'port
+            #:node-type %package-node-type
+            #:backend backend))))
+      ;; We should see nothing more than these 3 packages.
+      (let-values (((nodes edges) (nodes+edges)))
+        (and (equal? nodes (map package->tuple (list p3 p2 p1)))
+             (equal? edges
+                     (map edge->tuple
+                          (list p3 p3 p2 p1)
+                          (list p2 p1 p1 p3))))))))
+
 (test-assert "reverse package DAG"
   (let-values (((backend nodes+edges) (make-recording-backend)))
     (run-with-store %store
-- 
2.34.0





Information forwarded to guix-patches <at> gnu.org:
bug#53510; Package guix-patches. (Fri, 04 Feb 2022 22:13:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 53510 <at> debbugs.gnu.org
Subject: Re: bug#53510: [PATCH] tests: Assert that cyclic graphs can be
 produced.
Date: Fri, 04 Feb 2022 23:11:56 +0100
Liliana Marie Prikler <liliana.prikler <at> gmail.com> skribis:

> * tests/graph.scm ("package DAG, oops it was a cycle"): New test.

LGTM, thanks!

Ludo'.




bug closed, send any further explanations to 53510 <at> debbugs.gnu.org and Liliana Marie Prikler <liliana.prikler <at> gmail.com> Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 10 Feb 2022 21:22:01 GMT) Full text and rfc822 format available.

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

This bug report was last modified 3 years and 99 days ago.

Previous Next


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