From 876bae182d423217a10b2b1390f357447bf43d27 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 10 Feb 2020 07:52:32 +0000 Subject: Update the load-new-revision-job tests --- tests/jobs-load-new-guix-revision.scm | 113 +++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 43 deletions(-) (limited to 'tests') diff --git a/tests/jobs-load-new-guix-revision.scm b/tests/jobs-load-new-guix-revision.scm index 9f7b32f..b5ddc78 100644 --- a/tests/jobs-load-new-guix-revision.scm +++ b/tests/jobs-load-new-guix-revision.scm @@ -24,29 +24,38 @@ #t (mock ((guix-data-service jobs load-new-guix-revision) - store-item-for-channel + channel->derivations-by-system (lambda (conn channel) - "/gnu/store/test")) + '((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 guix-revision-id commit store-path) - #t)) + channel-derivations-by-system->guix-store-item + (lambda (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 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)))))))) (exec-query conn "TRUNCATE guix_revisions CASCADE") (exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE") @@ -55,17 +64,26 @@ #f (mock ((guix-data-service jobs load-new-guix-revision) - store-item-for-channel + channel->derivations-by-system (lambda (conn channel) - #f)) + '(x86_64-linux + . + ((manifest-entry-item . /gnu/store/foo.drv) + (profile . /gnu/store/bar.drv))))) - (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))))) + (mock + ((guix-data-service jobs load-new-guix-revision) + 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)))))) (exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE") @@ -73,29 +91,38 @@ #f (mock ((guix-data-service jobs load-new-guix-revision) - store-item-for-channel + channel->derivations-by-system (lambda (conn channel) - "/gnu/store/test")) + '(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 git-repository-id commit store-path) - #f)) + channel-derivations-by-system->guix-store-item + (lambda (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 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") -- cgit v1.2.3