aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-02-10 07:52:32 +0000
committerChristopher Baines <mail@cbaines.net>2020-02-11 08:55:16 +0000
commit876bae182d423217a10b2b1390f357447bf43d27 (patch)
treee020c83683a1baf85c1ae10010a485b16ce645ad
parente0ee3d224b9480e1a1328b06608b9d5dd49916d1 (diff)
downloaddata-service-876bae182d423217a10b2b1390f357447bf43d27.tar
data-service-876bae182d423217a10b2b1390f357447bf43d27.tar.gz
Update the load-new-revision-job tests
-rw-r--r--tests/jobs-load-new-guix-revision.scm113
1 files changed, 70 insertions, 43 deletions
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm
index 9f7b32f..b5ddc78 100644
--- a/tests/jobs-load-new-guix-revision.scm
+++ b/tests/jobs-load-new-guix-revision.scm
@@ -24,29 +24,38 @@
#t
(mock
((guix-data-service jobs load-new-guix-revision)
- store-item-for-channel
+ channel->derivations-by-system
(lambda (conn channel)
- "/gnu/store/test"))
+ '((x86_64-linux
+ .
+ ((manifest-entry-item . /gnu/store/foo.drv)
+ (profile . /gnu/store/bar.drv))))))
(mock
((guix-data-service jobs load-new-guix-revision)
- extract-information-from
- (lambda (conn guix-revision-id commit store-path)
- #t))
+ channel-derivations-by-system->guix-store-item
+ (lambda (channel-derivations-by-system)
+ "/gnu/store/test"))
(mock
- ((guix channels)
- channel-news-for-commit
- (lambda (channel commit)
- '()))
-
- (match (enqueue-load-new-guix-revision-job
- conn
- (git-repository-url->git-repository-id conn "test-url")
- "test-commit"
- "test-source")
- ((id)
- (process-load-new-guix-revision-job id)))))))
+ ((guix-data-service jobs load-new-guix-revision)
+ extract-information-from
+ (lambda (conn guix-revision-id commit store-path)
+ #t))
+
+ (mock
+ ((guix channels)
+ channel-news-for-commit
+ (lambda (channel commit)
+ '()))
+
+ (match (enqueue-load-new-guix-revision-job
+ conn
+ (git-repository-url->git-repository-id conn "test-url")
+ "test-commit"
+ "test-source")
+ ((id)
+ (process-load-new-guix-revision-job id))))))))
(exec-query conn "TRUNCATE guix_revisions CASCADE")
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")
@@ -55,17 +64,26 @@
#f
(mock
((guix-data-service jobs load-new-guix-revision)
- store-item-for-channel
+ channel->derivations-by-system
(lambda (conn channel)
- #f))
+ '(x86_64-linux
+ .
+ ((manifest-entry-item . /gnu/store/foo.drv)
+ (profile . /gnu/store/bar.drv)))))
- (match (enqueue-load-new-guix-revision-job
- conn
- (git-repository-url->git-repository-id conn "test-url")
- "test-commit"
- "test-source")
- ((id)
- (process-load-new-guix-revision-job id)))))
+ (mock
+ ((guix-data-service jobs load-new-guix-revision)
+ channel-derivations-by-system->guix-store-item
+ (lambda (channel-derivations-by-system)
+ #f))
+
+ (match (enqueue-load-new-guix-revision-job
+ conn
+ (git-repository-url->git-repository-id conn "test-url")
+ "test-commit"
+ "test-source")
+ ((id)
+ (process-load-new-guix-revision-job id))))))
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")
@@ -73,29 +91,38 @@
#f
(mock
((guix-data-service jobs load-new-guix-revision)
- store-item-for-channel
+ channel->derivations-by-system
(lambda (conn channel)
- "/gnu/store/test"))
+ '(x86_64-linux
+ .
+ ((manifest-entry-item . /gnu/store/foo.drv)
+ (profile . /gnu/store/bar.drv)))))
(mock
((guix-data-service jobs load-new-guix-revision)
- extract-information-from
- (lambda (conn git-repository-id commit store-path)
- #f))
+ channel-derivations-by-system->guix-store-item
+ (lambda (channel-derivations-by-system)
+ "/gnu/store/test"))
(mock
- ((guix channels)
- channel-news-for-commit
- (lambda (channel commit)
- '()))
-
- (match (enqueue-load-new-guix-revision-job
- conn
- (git-repository-url->git-repository-id conn "test-url")
- "test-commit"
- "test-source")
- ((id)
- (process-load-new-guix-revision-job id)))))))
+ ((guix-data-service jobs load-new-guix-revision)
+ extract-information-from
+ (lambda (conn git-repository-id commit store-path)
+ #f))
+
+ (mock
+ ((guix channels)
+ channel-news-for-commit
+ (lambda (channel commit)
+ '()))
+
+ (match (enqueue-load-new-guix-revision-job
+ conn
+ (git-repository-url->git-repository-id conn "test-url")
+ "test-commit"
+ "test-source")
+ ((id)
+ (process-load-new-guix-revision-job id))))))))
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")