From a063a2277e16765b986db6c974650fdd7614bf1d Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 23 Jul 2016 22:05:50 +0200 Subject: cuirass: Use database to store specifications. --- tests/database.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/database.scm b/tests/database.scm index 964cd00..39f9fcc 100644 --- a/tests/database.scm +++ b/tests/database.scm @@ -20,6 +20,18 @@ (use-modules (cuirass database) (srfi srfi-64)) +(define example-spec + '((#:id . 1) + (#:name . "guix") + (#:url . "git://git.savannah.gnu.org/guix.git") + (#:load-path . ".") + (#:file . "/tmp/gnu-system.scm") + (#:proc . hydra-jobs) + (#:arguments (subset . "hello")) + (#:branch . "master") + (#:tag . #f) + (#:commit . #f))) + (define* (make-dummy-job #:optional (name "foo")) `((#:name . ,name) (#:derivation . ,(string-append name ".drv")) @@ -56,6 +68,12 @@ INSERT INTO Evaluations (derivation, job_name, specification)\ VALUES ('drv3', 'job3', 3);") (sqlite-exec (%db) "SELECT * FROM Evaluations;"))) + (test-equal "db-add-specification" + example-spec + (begin + (db-add-specification (%db) example-spec) + (car (db-get-specifications (%db))))) + (test-assert "db-add-evaluation" (let* ((job (make-dummy-job)) (key (assq-ref job #:derivation))) -- cgit v1.2.3