Fix tests.

* tests/database.scm (db-init): Force database creation.
* tests/http.scm (db-init): Ditto.
* tests/metrics (db-init): Ditto.
This commit is contained in:
Mathieu Othacehe 2021-01-17 12:05:31 +01:00
parent 53d8b66bf9
commit e61e7a5ca4
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
4 changed files with 16 additions and 16 deletions

View File

@ -1017,22 +1017,19 @@ ORDER BY ~a;"
(params
(map (match-lambda
((name . value)
(let ((key
(symbol->keyword
(or (assq-ref
'((border-low-time . borderlowtime)
(border-high-time . borderhightime)
(border-low-id . borderlowid)
(border-high-id . borderhighid))
name)
name)))
(value
(match name
('nr (or value -1))
('order #f) ; Doesn't need binding.
('status #f) ; Doesn't need binding.
(else value))))
(cons key value))))
(cons (symbol->keyword
(or (assq-ref
'((border-low-time . borderlowtime)
(border-high-time . borderhightime)
(border-low-id . borderlowid)
(border-high-id . borderhighid))
name)
name))
(match name
('nr (or value -1))
('order #f) ; Doesn't need binding.
('status #f) ; Doesn't need binding.
(else value)))))
filters))
(builds (exec-query/bind-params db query params)))
(let loop ((builds builds)

View File

@ -91,6 +91,7 @@
(test-group-with-cleanup "database"
(test-assert "db-init"
(begin
(%create-database? #t)
(%db (db-open))
(%db-channel (make-worker-thread-channel
(lambda ()

View File

@ -107,6 +107,7 @@
(test-assert "db-init"
(begin
(%create-database? #t)
(%db (db-open))
(%db-channel (make-worker-thread-channel
(lambda ()

View File

@ -37,6 +37,7 @@
(test-group-with-cleanup "database"
(test-assert "db-init"
(begin
(%create-database? #t)
(%db (db-open))
(%db-channel (make-worker-thread-channel
(lambda ()