aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-09-10 14:25:19 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-09-10 15:16:15 +0200
commitf5b0d39328567a20336945bf1e2ff93aff1a9973 (patch)
tree6c42597061c14826ecd2cdfdc90559be44a814bd /tests
parentaf12a80599346968fb9f52edb33b48dd26852788 (diff)
downloadcuirass-f5b0d39328567a20336945bf1e2ff93aff1a9973.tar
cuirass-f5b0d39328567a20336945bf1e2ff93aff1a9973.tar.gz
Add a status field to Evaluation table.
The Evaluation table currently has an 'in_progress' field. Distinction between succeeded and failed evaluations are based on the presence of Builds records for the evaluation. It it also not possible to distinguish aborted evaluations from failed evaluations. Rename 'in_progress' field to 'status'. The 'status' field can be equal to 'started', 'succeeded', 'failed' or 'aborted'. * src/cuirass/database.scm (evaluation-status): New exported enumeration. (db-set-evaluations-done, db-set-evaluation-done): Remove them. (db-abort-pending-evaluations, db-set-evaluation-status): New exported procedures. (db-add-evaluation, db-get-builds, db-get-evaluations, db-get-evaluations-build-summary, db-get-evaluation-summary): Adapt to use 'status' field instead of 'in_progress' field. * src/cuirass/templates.scm (evaluation-badges): Ditto. * src/schema.sql (Evaluations): Rename 'in_progress' field to 'status'. * src/sql/upgrade-10.sql: New file. * bin/cuirass.in (main): Use "db-abort-pending-evaluations" instead of "db-set-evaluations-done". * src/cuirass/base.scm (evaluate): Use "db-set-evaluation-status" instead of "db-set-evaluations-done". (build-packages): Use "db-set-evaluation-status" instead of "db-set-evaluation-done". * tests/database.scm (sqlite-exec): Adapt accordingly. * tests/http.scm (evaluations-query-result): Ditto.
Diffstat (limited to 'tests')
-rw-r--r--tests/database.scm12
-rw-r--r--tests/http.scm2
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/database.scm b/tests/database.scm
index 8fd663d..01d7e67 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -97,14 +97,14 @@
(test-assert "sqlite-exec"
(begin
(sqlite-exec (%db) "\
-INSERT INTO Evaluations (specification, in_progress,
-timestamp, checkouttime, evaltime) VALUES (1, false, 0, 0, 0);")
+INSERT INTO Evaluations (specification, status,
+timestamp, checkouttime, evaltime) VALUES (1, 0, 0, 0, 0);")
(sqlite-exec (%db) "\
-INSERT INTO Evaluations (specification, in_progress,
-timestamp, checkouttime, evaltime) VALUES (2, false, 0, 0, 0);")
+INSERT INTO Evaluations (specification, status,
+timestamp, checkouttime, evaltime) VALUES (2, 0, 0, 0, 0);")
(sqlite-exec (%db) "\
-INSERT INTO Evaluations (specification, in_progress,
-timestamp, checkouttime, evaltime) VALUES (3, false, 0, 0, 0);")
+INSERT INTO Evaluations (specification, status,
+timestamp, checkouttime, evaltime) VALUES (3, 0, 0, 0, 0);")
(sqlite-exec (%db) "SELECT * FROM Evaluations;")))
(test-equal "db-add-specification"
diff --git a/tests/http.scm b/tests/http.scm
index f80e515..e2d6982 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -78,7 +78,7 @@
(define evaluations-query-result
#(((#:id . 2)
(#:specification . "guix")
- (#:in-progress . 1)
+ (#:status . -1)
(#:checkouts . #(((#:commit . "fakesha2")
(#:input . "savannah")
(#:directory . "dir3")))))))