aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-11-05 13:42:03 +0000
committerChristopher Baines <mail@cbaines.net>2023-11-05 13:46:20 +0000
commitc3cb04cb8052492dae715012586f9e3d2d64579d (patch)
tree1f56c415ef46e68d60d623e0a0bea70c4bd74ceb /tests
parentf5acc60288e0ad9f0c1093f3d50af1347e4df1df (diff)
downloaddata-service-c3cb04cb8052492dae715012586f9e3d2d64579d.tar
data-service-c3cb04cb8052492dae715012586f9e3d2d64579d.tar.gz
Use fibers when processing new revisions
Just have one fiber at the moment, but this will enable using fibers for parallelism in the future. Fibers seemed to cause problems with the logging setup, which was a bit odd in the first place. So move logging to the parent process which is better anyway.
Diffstat (limited to 'tests')
-rw-r--r--tests/jobs-load-new-guix-revision.scm52
1 files changed, 23 insertions, 29 deletions
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm
index 0eaad3f..8213afb 100644
--- a/tests/jobs-load-new-guix-revision.scm
+++ b/tests/jobs-load-new-guix-revision.scm
@@ -48,43 +48,37 @@
(mock
((guix-data-service jobs load-new-guix-revision)
- setup-logging
- (lambda (conn thunk)
- (thunk)))
+ channel-derivations-by-system->guix-store-item
+ (lambda (store channel-derivations-by-system)
+ "/gnu/store/test"))
(mock
((guix-data-service jobs load-new-guix-revision)
- channel-derivations-by-system->guix-store-item
- (lambda (store channel-derivations-by-system)
- "/gnu/store/test"))
+ extract-information-from
+ (lambda* (conn store guix-revision-id commit
+ guix-source store-path
+ #:key skip-system-tests?)
+ #t))
(mock
- ((guix-data-service jobs load-new-guix-revision)
- extract-information-from
- (lambda* (conn store guix-revision-id commit
- guix-source store-path
- #:key skip-system-tests?)
+ ((guix-data-service model channel-instance)
+ insert-channel-instances
+ (lambda (conn guix-revision-id derivations-by-system)
#t))
(mock
- ((guix-data-service model channel-instance)
- insert-channel-instances
- (lambda (conn guix-revision-id derivations-by-system)
- #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)))))))))))
+ ((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")