Remove unmaintainable tests

This needs rethinking, it's not feasible to maintain tests if you have to
struggle to get backtraces when they fail and they rely on fragile and broken
mocking.
This commit is contained in:
Christopher Baines 2025-02-11 10:29:45 +00:00
parent 37b7c568ed
commit 522c7cd9a2

View file

@ -111,108 +111,6 @@
(exec-query conn "TRUNCATE guix_revisions CASCADE")
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")
(test-equal "test build store item failure"
#f
(mock
((guix-data-service jobs load-new-guix-revision)
with-store-connection
(lambda (f)
(f 'fake-store-connection)))
(mock
((guix-data-service jobs load-new-guix-revision)
channel->source-and-derivations-by-system
(lambda* (conn channel fetch-with-authentication?
#:key parallelism)
(values
"/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)
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 (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")
(test-equal "test extract information failure"
#f
(mock
((guix-data-service jobs load-new-guix-revision)
with-store-connection
(lambda (f)
(f 'fake-store-connection)))
(mock
((guix-data-service jobs load-new-guix-revision)
channel->source-and-derivations-by-system
(lambda* (conn channel fetch-with-authentication?
#:key parallelism)
(values
"/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)
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 (channel-derivations-by-system)
"/gnu/store/test"))
(mock
((guix-data-service jobs load-new-guix-revision)
extract-information-from
(lambda* (conn git-repository-id commit
guix-source store-path
#:key skip-system-tests?
extra-inferior-environment-variables
parallelism)
#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")
(test-assert "test duplicate job handling"
(with-postgresql-transaction
conn