diff options
author | Mathieu Lirzin <mthl@gnu.org> | 2016-07-23 22:05:50 +0200 |
---|---|---|
committer | Mathieu Lirzin <mthl@gnu.org> | 2016-07-25 02:37:00 +0200 |
commit | a063a2277e16765b986db6c974650fdd7614bf1d (patch) | |
tree | efc7fecd0a87a3997446f747f3eeb18cca577379 /tests | |
parent | 5db6894ae24ef0925b19adcfcc15bc9f6e01143b (diff) | |
download | cuirass-a063a2277e16765b986db6c974650fdd7614bf1d.tar cuirass-a063a2277e16765b986db6c974650fdd7614bf1d.tar.gz |
cuirass: Use database to store specifications.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/database.scm | 18 |
1 files changed, 18 insertions, 0 deletions
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))) |