aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-08-07 17:21:49 +0100
committerChristopher Baines <mail@cbaines.net>2024-08-07 17:21:49 +0100
commit885a4758d312c5a54be6ba216d2aec9afe32c7f5 (patch)
treedb2c0154a4b77b0e70664894874c6f4956291858
parent77962f7c2c4cb1f6b78e5bac48e9471dee009136 (diff)
downloaddata-service-885a4758d312c5a54be6ba216d2aec9afe32c7f5.tar
data-service-885a4758d312c5a54be6ba216d2aec9afe32c7f5.tar.gz
Get the test suite working again
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm2
-rw-r--r--tests/jobs-load-new-guix-revision.scm54
2 files changed, 27 insertions, 29 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index c9ec9e1..1b13881 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -1199,6 +1199,8 @@ SELECT 1 FROM derivation_source_file_nars WHERE derivation_source_file_id = $1"
all-ids))))
+(prevent-inlining-for-tests derivation-file-names->derivation-ids)
+
(define guix-store-path
(let ((store-path #f))
(lambda (store)
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm
index 1b993cb..6d47fb9 100644
--- a/tests/jobs-load-new-guix-revision.scm
+++ b/tests/jobs-load-new-guix-revision.scm
@@ -2,6 +2,7 @@
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (squee)
+ #:use-module (fibers)
#:use-module (guix utils)
#:use-module (guix store)
#:use-module (guix tests)
@@ -62,11 +63,7 @@
(mock
((guix-data-service jobs load-new-guix-revision)
extract-information-from
- (lambda* (conn guix-revision-id commit
- guix-source store-path
- #:key skip-system-tests?
- extra-inferior-environment-variables
- parallelism)
+ (lambda _
#t))
(mock
@@ -81,6 +78,12 @@
(lambda (channel commit)
'()))
+ (mock
+ ((guix-data-service jobs load-new-guix-revision)
+ derivation-file-names->derivation-ids
+ (lambda _
+ #(1)))
+
(mock
((guix store)
add-temp-root
@@ -97,7 +100,12 @@
"test-commit"
"test-source")
((id)
- (process-load-new-guix-revision-job id)))))))))))))
+ (run-fibers
+ (lambda ()
+ (process-load-new-guix-revision-job
+ id #:parallelism 1))
+ #:hz 0
+ #:parallelism 1))))))))))))))
(exec-query conn "TRUNCATE guix_revisions CASCADE")
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")
@@ -131,23 +139,17 @@
(mock
((guix-data-service jobs load-new-guix-revision)
- setup-logging
- (lambda (conn thunk)
- (thunk)))
-
- (mock
- ((guix-data-service jobs load-new-guix-revision)
- channel-derivations-by-system->guix-store-item
- (lambda (channel-derivations-by-system)
- #f))
+ 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)))))))))
+ (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")
@@ -178,12 +180,6 @@
channel-derivations-by-system)
0))
- (mock
- ((guix-data-service jobs load-new-guix-revision)
- setup-logging
- (lambda (conn thunk)
- (thunk)))
-
(mock
((guix-data-service jobs load-new-guix-revision)
channel-derivations-by-system->guix-store-item
@@ -212,7 +208,7 @@
"test-commit"
"test-source")
((id)
- (process-load-new-guix-revision-job id)))))))))))
+ (process-load-new-guix-revision-job id))))))))))
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")