Address a few issues in the load new guix revision tests
This commit is contained in:
parent
f86657915e
commit
3a90798567
2 changed files with 61 additions and 45 deletions
|
|
@ -1402,6 +1402,8 @@ WHERE job_id = $1")
|
|||
|
||||
guix-revision-id))))))
|
||||
|
||||
(prevent-inlining-for-tests load-channel-instances)
|
||||
|
||||
(define (load-new-guix-revision conn store git-repository-id commit)
|
||||
(let* ((git-repository-fields
|
||||
(select-git-repository conn git-repository-id))
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@
|
|||
((guix-data-service jobs load-new-guix-revision)
|
||||
channel->derivations-by-system
|
||||
(lambda (conn store channel fetch-with-authentication?)
|
||||
'((x86_64-linux
|
||||
'(("x86_64-linux"
|
||||
.
|
||||
((manifest-entry-item . /gnu/store/foo.drv)
|
||||
(profile . /gnu/store/bar.drv))))))
|
||||
((manifest-entry-item . "/gnu/store/foo.drv")
|
||||
(profile . "/gnu/store/bar.drv"))))))
|
||||
|
||||
(mock
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
|
|
@ -97,30 +97,37 @@
|
|||
((guix-data-service jobs load-new-guix-revision)
|
||||
channel->derivations-by-system
|
||||
(lambda (conn store channel fetch-with-authentication?)
|
||||
'(x86_64-linux
|
||||
.
|
||||
((manifest-entry-item . /gnu/store/foo.drv)
|
||||
(profile . /gnu/store/bar.drv)))))
|
||||
'(("x86_64-linux"
|
||||
.
|
||||
((manifest-entry-item . "/gnu/store/foo.drv")
|
||||
(profile . "/gnu/store/bar.drv"))))))
|
||||
|
||||
(mock
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
setup-logging
|
||||
(lambda (conn thunk)
|
||||
(thunk)))
|
||||
load-channel-instances
|
||||
(lambda (git-repository-id commit
|
||||
channel-derivations-by-system)
|
||||
0))
|
||||
|
||||
(mock
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
channel-derivations-by-system->guix-store-item
|
||||
(lambda (store channel-derivations-by-system)
|
||||
#f))
|
||||
setup-logging
|
||||
(lambda (conn thunk)
|
||||
(thunk)))
|
||||
|
||||
(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 (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")
|
||||
|
||||
|
|
@ -135,43 +142,50 @@
|
|||
(mock
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
channel->derivations-by-system
|
||||
(lambda (conn store channel)
|
||||
'(x86_64-linux
|
||||
.
|
||||
((manifest-entry-item . /gnu/store/foo.drv)
|
||||
(profile . /gnu/store/bar.drv)))))
|
||||
(lambda (conn store channel fetch-with-authentication?)
|
||||
'(("x86_64-linux"
|
||||
.
|
||||
((manifest-entry-item . "/gnu/store/foo.drv")
|
||||
(profile . "/gnu/store/bar.drv"))))))
|
||||
|
||||
(mock
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
setup-logging
|
||||
(lambda (conn thunk)
|
||||
(thunk)))
|
||||
load-channel-instances
|
||||
(lambda (git-repository-id commit
|
||||
channel-derivations-by-system)
|
||||
0))
|
||||
|
||||
(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)
|
||||
'()))
|
||||
((guix-data-service jobs load-new-guix-revision)
|
||||
extract-information-from
|
||||
(lambda (conn store git-repository-id commit store-path)
|
||||
#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))))))))))
|
||||
(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")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue