aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-11-18 19:49:12 +0000
committerChristopher Baines <mail@cbaines.net>2019-11-21 19:56:19 +0000
commitf23ee71ea7efedd14843a474f87550d7d991cca7 (patch)
tree8cd28619404580417a83dd866aaf54f98dac0fac /tests
parent2e8ca7f547800f1455214be24525ff64ea095e4a (diff)
downloaddata-service-f23ee71ea7efedd14843a474f87550d7d991cca7.tar
data-service-f23ee71ea7efedd14843a474f87550d7d991cca7.tar.gz
Insert channel news entries when loading new guix revisions
If the channel-news-for-commit function is present.
Diffstat (limited to 'tests')
-rw-r--r--tests/jobs-load-new-guix-revision.scm48
1 files changed, 31 insertions, 17 deletions
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm
index 8f82e10..9f7b32f 100644
--- a/tests/jobs-load-new-guix-revision.scm
+++ b/tests/jobs-load-new-guix-revision.scm
@@ -14,6 +14,8 @@
(with-postgresql-connection
"test-jobs-load-new-guix-revision"
(lambda (conn)
+ (exec-query conn "TRUNCATE guix_revisions CASCADE")
+
(test-equal "select-job-for-commit works"
'()
(select-job-for-commit conn "does not exist"))
@@ -29,17 +31,24 @@
(mock
((guix-data-service jobs load-new-guix-revision)
extract-information-from
- (lambda (conn git-repository-id commit store-path)
+ (lambda (conn guix-revision-id commit store-path)
#t))
- (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 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")
(test-equal "test build store item failure"
@@ -74,13 +83,19 @@
(lambda (conn git-repository-id commit store-path)
#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))))))
+ (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")
@@ -101,5 +116,4 @@
#t)
#:always-rollback? #t))))
-
(test-end)