aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-02-14 09:18:28 +0000
committerChristopher Baines <mail@cbaines.net>2020-02-14 09:18:28 +0000
commitf6f51bbe0dc89dfec6d1d6e74818ad1f9c2d6dbc (patch)
treef176b42c47b4b7e136fedd9f302bf560249c445c /guix-data-service
parent374dc25440efaef619cdc8d3288261c20ce45858 (diff)
downloaddata-service-f6f51bbe0dc89dfec6d1d6e74818ad1f9c2d6dbc.tar
data-service-f6f51bbe0dc89dfec6d1d6e74818ad1f9c2d6dbc.tar.gz
Fake the store connection in the tests
So that the tests don't require a store connection.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index dc18267..349d40a 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -1499,6 +1499,12 @@ SKIP LOCKED")
(string=? priority "t"))))
(exec-query conn query)))
+(define (with-store-connection f)
+ (with-store store
+ (set-build-options store #:fallback? #t)
+
+ (f store)))
+
(define (process-load-new-guix-revision-job id)
(with-postgresql-connection
(simple-format #f "load-new-guix-revision ~A" id)
@@ -1544,12 +1550,12 @@ SKIP LOCKED")
(real-error-port previous-error-port))
(catch #t
(lambda ()
- (with-store store
- (set-build-options store #:fallback? #t)
- (load-new-guix-revision conn
- store
- git-repository-id
- commit)))
+ (with-store-connection
+ (lambda (store)
+ (load-new-guix-revision conn
+ store
+ git-repository-id
+ commit))))
(lambda (key . args)
(simple-format
(current-error-port)