[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Fix tests.
From: |
Mathieu Othacehe |
Subject: |
branch master updated: Fix tests. |
Date: |
Sun, 17 Jan 2021 06:06:33 -0500 |
This is an automated email from the git hooks/post-receive script.
mothacehe pushed a commit to branch master
in repository guix-cuirass.
The following commit(s) were added to refs/heads/master by this push:
new e61e7a5 Fix tests.
e61e7a5 is described below
commit e61e7a5ca4c24c20c502ff820f8ed2ec1878deaa
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Jan 17 12:05:31 2021 +0100
Fix tests.
* tests/database.scm (db-init): Force database creation.
* tests/http.scm (db-init): Ditto.
* tests/metrics (db-init): Ditto.
---
src/cuirass/database.scm | 29 +++++++++++++----------------
tests/database.scm | 1 +
tests/http.scm | 1 +
tests/metrics.scm | 1 +
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 9892cfa..6f76100 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -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)
diff --git a/tests/database.scm b/tests/database.scm
index 037cbbf..b640f83 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -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 ()
diff --git a/tests/http.scm b/tests/http.scm
index fb0d858..9c44b8e 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -107,6 +107,7 @@
(test-assert "db-init"
(begin
+ (%create-database? #t)
(%db (db-open))
(%db-channel (make-worker-thread-channel
(lambda ()
diff --git a/tests/metrics.scm b/tests/metrics.scm
index efa1a8e..7a1b0b4 100644
--- a/tests/metrics.scm
+++ b/tests/metrics.scm
@@ -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 ()