aboutsummaryrefslogtreecommitdiff
path: root/tests/channels.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-05-08 21:40:51 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-05-08 21:40:51 +0200
commit4bdf4182fe080c3409f6ef9b410146b67cfa2595 (patch)
treef1123ddb8c57eda6de026982904f6c5309adaca6 /tests/channels.scm
parentc81457a5883ea43950eb2ecdcbb58a5b144bcd11 (diff)
parent23a59b180b28b9fa22120c2b8305b9324442b94d (diff)
downloadguix-4bdf4182fe080c3409f6ef9b410146b67cfa2595.tar
guix-4bdf4182fe080c3409f6ef9b410146b67cfa2595.tar.gz
Merge branch 'core-updates'
Diffstat (limited to 'tests/channels.scm')
-rw-r--r--tests/channels.scm64
1 files changed, 34 insertions, 30 deletions
diff --git a/tests/channels.scm b/tests/channels.scm
index f5a7955483..910088ba15 100644
--- a/tests/channels.scm
+++ b/tests/channels.scm
@@ -135,44 +135,48 @@
(name 'test)
(url "test")))
(test-dir (channel-instance-checkout instance--simple)))
- (mock ((guix git) latest-repository-commit
- (lambda* (store url #:key ref)
+ (mock ((guix git) update-cached-checkout
+ (lambda* (url #:key ref)
(match url
- ("test" (values test-dir 'whatever))
- (_ (values "/not-important" 'not-important)))))
- (let ((instances (latest-channel-instances #f (list channel))))
- (and (eq? 2 (length instances))
- (lset= eq?
- '(test test-channel)
- (map (compose channel-name channel-instance-channel)
- instances)))))))
+ ("test" (values test-dir "caf3cabba9e"))
+ (_ (values (channel-instance-checkout instance--no-deps)
+ "abcde1234")))))
+ (with-store store
+ (let ((instances (latest-channel-instances store (list channel))))
+ (and (eq? 2 (length instances))
+ (lset= eq?
+ '(test test-channel)
+ (map (compose channel-name channel-instance-channel)
+ instances))))))))
(test-assert "latest-channel-instances excludes duplicate channel dependencies"
(let* ((channel (channel
(name 'test)
(url "test")))
(test-dir (channel-instance-checkout instance--with-dupes)))
- (mock ((guix git) latest-repository-commit
- (lambda* (store url #:key ref)
+ (mock ((guix git) update-cached-checkout
+ (lambda* (url #:key ref)
(match url
- ("test" (values test-dir 'whatever))
- (_ (values "/not-important" 'not-important)))))
- (let ((instances (latest-channel-instances #f (list channel))))
- (and (= 2 (length instances))
- (lset= eq?
- '(test test-channel)
- (map (compose channel-name channel-instance-channel)
- instances))
- ;; only the most specific channel dependency should remain,
- ;; i.e. the one with a specified commit.
- (find (lambda (instance)
- (and (eq? (channel-name
- (channel-instance-channel instance))
- 'test-channel)
- (string=? (channel-commit
- (channel-instance-channel instance))
- "abc1234")))
- instances))))))
+ ("test" (values test-dir "caf3cabba9e"))
+ (_ (values (channel-instance-checkout instance--no-deps)
+ "abcde1234")))))
+ (with-store store
+ (let ((instances (latest-channel-instances store (list channel))))
+ (and (= 2 (length instances))
+ (lset= eq?
+ '(test test-channel)
+ (map (compose channel-name channel-instance-channel)
+ instances))
+ ;; only the most specific channel dependency should remain,
+ ;; i.e. the one with a specified commit.
+ (find (lambda (instance)
+ (and (eq? (channel-name
+ (channel-instance-channel instance))
+ 'test-channel)
+ (string=? (channel-commit
+ (channel-instance-channel instance))
+ "abc1234")))
+ instances)))))))
(test-assert "channel-instances->manifest"
;; Compute the manifest for a graph of instances and make sure we get a