diff options
author | Christopher Baines <mail@cbaines.net> | 2024-04-25 22:01:22 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-04-25 22:01:22 +0100 |
commit | 993887fe0c5fcdb17c0583df50b868201761b85c (patch) | |
tree | fc06cdad34f1ff457c3370239dc0b0223f962156 /tests | |
parent | c18589249f4b78994db6715226334a28ae6bc85f (diff) | |
download | data-service-993887fe0c5fcdb17c0583df50b868201761b85c.tar data-service-993887fe0c5fcdb17c0583df50b868201761b85c.tar.gz |
Further change job store connection handling
The guix-dameon WAL is still growing excessively, so avoid doing anything with
the long running store connection except registering temporary roots.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jobs-load-new-guix-revision.scm | 82 |
1 files changed, 49 insertions, 33 deletions
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm index a2beb64..1a64ce3 100644 --- a/tests/jobs-load-new-guix-revision.scm +++ b/tests/jobs-load-new-guix-revision.scm @@ -37,50 +37,66 @@ (mock ((guix-data-service jobs load-new-guix-revision) - channel->source-and-derivations-by-system - (lambda* (conn store channel fetch-with-authentication? - #:key parallelism) - (cons - "/gnu/store/guix" - '(("x86_64-linux" - . - ((manifest-entry-item . "/gnu/store/foo.drv") - (profile . "/gnu/store/bar.drv"))))))) + open-store-connection + (lambda () + 'fake-store-connection)) (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")) + channel->source-and-derivations-by-system + (lambda* (conn store channel fetch-with-authentication? + #:key parallelism) + (cons + "/gnu/store/guix" + '(("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 store guix-revision-id commit - guix-source store-path - #:key skip-system-tests? - parallelism) - #t)) + channel-derivations-by-system->guix-store-item + (lambda (store channel-derivations-by-system) + "/gnu/store/test")) (mock - ((guix-data-service model channel-instance) - insert-channel-instances - (lambda (conn guix-revision-id derivations-by-system) + ((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? + parallelism) #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-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) + '())) + + (mock + ((guix store) + add-temp-root + (lambda _ #f)) + + (mock + ((guix store) + close-connection + (lambda _ #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 guix_revisions CASCADE") (exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE") |