aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2020-07-25 14:22:20 +0200
committerMathieu Othacehe <othacehe@gnu.org>2020-07-25 14:22:20 +0200
commit17395e85d2793ec4cb47e53bcbdb5b06187147bd (patch)
treea79c6802b67afdd06b41a3bdf0d29e4cfeb71902 /tests
parentd11ce40a10eae8b60eb0d0c076fe83d7861cca30 (diff)
downloadcuirass-17395e85d2793ec4cb47e53bcbdb5b06187147bd.tar
cuirass-17395e85d2793ec4cb47e53bcbdb5b06187147bd.tar.gz
Fix spec reading when restarting builds.
When "spawn-builds" is called to restart builds, the spec is not known, preventing build products from being created as reported here: https://issues.guix.gnu.org/42523 Fix this issue by reading the specification in database in "set-build-successful!" procedure. * src/cuirass/database.scm (db-get-specification): New exported procedure, (db-get-specifications): add an optional name argument. * tests/database.scm (db-get-specification): Add a corresponding test-case. * src/cuirass/base.scm (set-build-successful!): Remove spec argument and read it directly from database instead, (update-build-statuses!): also remove spec argument, adapt set-build-successful! call accordingly, (spawn-builds): remove spec argument and adapt handle-build-event and update-build-statuses! calls accordingly, (handle-build-event): remove spec argument, adapt set-build-successful! call accordingly, (build-packages): remove spec argument, adapt spawn-builds call accordingly, (process-specs): adapt build-packages call.
Diffstat (limited to 'tests')
-rw-r--r--tests/database.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/database.scm b/tests/database.scm
index 98b5012..944e4bf 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -110,6 +110,10 @@ INSERT INTO Evaluations (specification, in_progress) VALUES (3, false);")
(db-add-specification example-spec)
(car (db-get-specifications))))
+ (test-equal "db-get-specification"
+ example-spec
+ (db-get-specification "guix"))
+
(test-equal "db-add-build"
#f
(let ((build (make-dummy-build "/foo.drv")))