Check that the test database is being used in all the tests

This commit is contained in:
Christopher Baines 2020-02-24 21:16:41 +00:00
parent b337c5fcb2
commit ffdde6ba36
11 changed files with 22 additions and 0 deletions

View file

@ -109,6 +109,8 @@ Summary of changes:
(with-postgresql-connection (with-postgresql-connection
"test-branch-updated-emails" "test-branch-updated-emails"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "enqueue-job-for-email works" (test-assert "enqueue-job-for-email works"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -17,6 +17,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-jobs-load-new-guix-revision" "test-jobs-load-new-guix-revision"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(exec-query conn "TRUNCATE guix_revisions CASCADE") (exec-query conn "TRUNCATE guix_revisions CASCADE")
(test-equal "select-job-for-commit works" (test-equal "select-job-for-commit works"

View file

@ -8,6 +8,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-derivation" "test-model-derivation"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-equal "valid-systems" (test-equal "valid-systems"
'("aarch64-linux" "armhf-linux" "i686-linux" "mips64el-linux" "x86_64-linux") '("aarch64-linux" "armhf-linux" "i686-linux" "mips64el-linux" "x86_64-linux")
(valid-systems conn)) (valid-systems conn))

View file

@ -10,6 +10,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-module-git-branch" "test-module-git-branch"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "insert-git-branch-entry works" (test-assert "insert-git-branch-entry works"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -9,6 +9,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-git-repository" "test-model-git-repository"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "returns an id for a non existent URL" (test-assert "returns an id for a non existent URL"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -27,6 +27,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-license-set" "test-model-license-set"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(with-postgresql-transaction (with-postgresql-transaction
conn conn
(lambda (conn) (lambda (conn)

View file

@ -28,6 +28,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-license" "test-model-license"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(with-postgresql-transaction (with-postgresql-transaction
conn conn
(lambda (conn) (lambda (conn)

View file

@ -13,6 +13,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-lint-checker" "test-model-lint-checker"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "single insert" (test-assert "single insert"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -13,6 +13,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-lint-checker" "test-model-lint-checker"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "single insert" (test-assert "single insert"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -48,6 +48,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-package-metadata" "test-model-package-metadata"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(test-assert "inferior-packages->package-metadata-ids" (test-assert "inferior-packages->package-metadata-ids"
(with-postgresql-transaction (with-postgresql-transaction
conn conn

View file

@ -55,6 +55,8 @@
(with-postgresql-connection (with-postgresql-connection
"test-model-package" "test-model-package"
(lambda (conn) (lambda (conn)
(check-test-database! conn)
(with-postgresql-transaction (with-postgresql-transaction
conn conn
(lambda (conn) (lambda (conn)