[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/07: tests: Make sure substituted items are deduplicated.
From: |
guix-commits |
Subject: |
05/07: tests: Make sure substituted items are deduplicated. |
Date: |
Sat, 19 Dec 2020 17:28:33 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 3c799ccb98ba2ea4c19747306289586e42ae493b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Dec 14 15:33:00 2020 +0100
tests: Make sure substituted items are deduplicated.
* tests/store.scm ("substitute, deduplication"): New test.
---
tests/store.scm | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/store.scm b/tests/store.scm
index 4dc125b..c9a08ac 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -718,6 +718,30 @@
(canonical-file? o)
(equal? c (call-with-input-file o get-string-all)))))))
+(test-assert "substitute, deduplication"
+ (with-store s
+ (let* ((c (random-text)) ; contents of the output
+ (g (package-derivation s %bootstrap-guile))
+ (d1 (build-expression->derivation s "substitute-me"
+ `(begin ,c (exit 1))
+ #:guile-for-build g))
+ (d2 (build-expression->derivation s "build-me"
+ `(call-with-output-file %output
+ (lambda (p)
+ (display ,c p)))
+ #:guile-for-build g))
+ (o1 (derivation->output-path d1))
+ (o2 (derivation->output-path d2)))
+ (with-derivation-substitute d1 c
+ (set-build-options s #:use-substitutes? #t
+ #:substitute-urls (%test-substitute-urls))
+ (and (has-substitutes? s o1)
+ (build-derivations s (list d2)) ;build
+ (build-derivations s (list d1)) ;substitute
+ (canonical-file? o1)
+ (equal? c (call-with-input-file o1 get-string-all))
+ (= (stat:ino (stat o1)) (stat:ino (stat o2))))))))
+
(test-assert "substitute + build-things with output path"
(with-store s
(let* ((c (random-text)) ;contents of the output
- branch master updated (f6f6e1e -> 4f621a2), guix-commits, 2020/12/19
- 01/07: tests: Check the build trace for hash mismatches on substitutes., guix-commits, 2020/12/19
- 03/07: tests: Check the mtime and permissions of substituted items., guix-commits, 2020/12/19
- 02/07: daemon: Let 'guix substitute' perform hash checks., guix-commits, 2020/12/19
- 05/07: tests: Make sure substituted items are deduplicated.,
guix-commits <=
- 06/07: daemon: Delegate deduplication to 'guix substitute'., guix-commits, 2020/12/19
- 07/07: maint: Require Guile >= 2.2.6., guix-commits, 2020/12/19
- 04/07: daemon: Do not reset timestamps and permissions on substituted items., guix-commits, 2020/12/19