guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/06: tests: Avoid 'delete-paths' calls for 'derivation-prerequisites-t


From: guix-commits
Subject: 01/06: tests: Avoid 'delete-paths' calls for 'derivation-prerequisites-to-build'.
Date: Tue, 18 Jun 2019 11:03:53 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 5c7f87881a52a6424fc6722376b990284a06de5a
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 17 22:48:44 2019 +0200

    tests: Avoid 'delete-paths' calls for 'derivation-prerequisites-to-build'.
    
    * tests/derivations.scm ("derivation-prerequisites-to-build when outputs
    already present"): Insert random text in BUILDER, and remove two calls
    to 'delete-paths'.  Use 'derivation->output-path' for INPUT-PATH instead
    of an old idiom.
---
 tests/derivations.scm | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/tests/derivations.scm b/tests/derivations.scm
index c421d09..93f4cdd 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -816,20 +816,17 @@
     (null? (derivation-prerequisites-to-build %store drv))))
 
 (test-assert "derivation-prerequisites-to-build when outputs already present"
-  (let* ((builder    '(begin (mkdir %output) #t))
+  (let* ((builder    `(begin ,(random-text) (mkdir %output) #t))
          (input-drv  (build-expression->derivation %store "input" builder))
-         (input-path (derivation-output-path
-                      (assoc-ref (derivation-outputs input-drv)
-                                 "out")))
+         (input-path (derivation->output-path input-drv))
          (drv        (build-expression->derivation %store "something" builder
                                                    #:inputs
                                                    `(("i" ,input-drv))))
          (output     (derivation->output-path drv)))
-    ;; Make sure these things are not already built.
-    (when (valid-path? %store input-path)
-      (delete-paths %store (list input-path)))
-    (when (valid-path? %store output)
-      (delete-paths %store (list output)))
+    ;; Assume these things are not already built.
+    (when (or (valid-path? %store input-path)
+              (valid-path? %store output))
+      (error "things already built" input-drv))
 
     (and (equal? (map derivation-input-path
                       (derivation-prerequisites-to-build %store drv))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]