diff options
author | Christopher Baines <mail@cbaines.net> | 2020-02-27 21:20:24 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-02-27 21:20:24 +0000 |
commit | 1ad581b05a5335558e1ad78fe6abe8e2451076fe (patch) | |
tree | 07f42a0c2d41e4e3412a2211a29a4e216079ce76 /tests | |
parent | a95c5ca5c927abb98655f89901ef8732b0fb75ee (diff) | |
download | data-service-1ad581b05a5335558e1ad78fe6abe8e2451076fe.tar data-service-1ad581b05a5335558e1ad78fe6abe8e2451076fe.tar.gz |
Do some more mocking in the jobs-load-new-guix-revision tests
To help with getting them running on Guile 3.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jobs-load-new-guix-revision.scm | 118 |
1 files changed, 68 insertions, 50 deletions
diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm index 9b1eb25..08dd6f1 100644 --- a/tests/jobs-load-new-guix-revision.scm +++ b/tests/jobs-load-new-guix-revision.scm @@ -46,35 +46,41 @@ (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")) + setup-logging + (lambda (conn thunk) + (thunk))) (mock ((guix-data-service jobs load-new-guix-revision) - extract-information-from - (lambda (conn store guix-revision-id commit store-path) - #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 store-path) #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) + '())) + + (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") @@ -98,17 +104,23 @@ (mock ((guix-data-service jobs load-new-guix-revision) - channel-derivations-by-system->guix-store-item - (lambda (store 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))))))) + setup-logging + (lambda (conn thunk) + (thunk))) + + (mock + ((guix-data-service jobs load-new-guix-revision) + channel-derivations-by-system->guix-store-item + (lambda (store 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)))))))) (exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE") @@ -131,29 +143,35 @@ (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")) + setup-logging + (lambda (conn thunk) + (thunk))) (mock ((guix-data-service jobs load-new-guix-revision) - extract-information-from - (lambda (conn store git-repository-id commit store-path) - #f)) + channel-derivations-by-system->guix-store-item + (lambda (store channel-derivations-by-system) + "/gnu/store/test")) (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 jobs load-new-guix-revision) + extract-information-from + (lambda (conn store git-repository-id commit store-path) + #f)) + + (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") |