summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2018-07-02 17:25:31 +0200
committerClément Lassieur <clement@lassieur.org>2018-07-14 21:35:14 +0200
commitbe713f8a30788861806a74865b07403aa6774117 (patch)
tree41a687a50f29b5bd4eca36906fb8daf14d8b440c /tests
parent03c4095f0a1a614af3b1e1cd63270d28d98b39a3 (diff)
downloadcuirass-be713f8a30788861806a74865b07403aa6774117.tar
cuirass-be713f8a30788861806a74865b07403aa6774117.tar.gz
database: Call a specification 'jobset' instead of 'project'.
This removes the possibility to filter specifications by branch, because branches were previously called 'jobset'. But it doesn't matter because later on, specifications will have as many branches as inputs. And people should filter by specification name instead. * doc/cuirass.texi (Build Information, Latest builds): Remove 'jobset', replace 'project' with 'jobset'. * src/cuirass/http.scm (build->hydra-build): Idem. * tests/database.scm (db-get-builds): Idem. * tests/http.scm (build-query-result, /api/latestbuilds?nr=1&jobset=guix, /api/latestbuilds?nr=1&jobset=gnu): Idem. * src/cuirass/database.scm (db-format-build, db-get-builds): Don't associate builds with branches (which were called 'jobset' afterwards). (db-get-builds): Remove the #:project filter.
Diffstat (limited to 'tests')
-rw-r--r--tests/database.scm6
-rw-r--r--tests/http.scm12
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/database.scm b/tests/database.scm
index 847c8a6..e71c7f7 100644
--- a/tests/database.scm
+++ b/tests/database.scm
@@ -2,6 +2,7 @@
;;;
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of Cuirass.
;;;
@@ -156,7 +157,6 @@ INSERT INTO Evaluations (specification, revision) VALUES (3, 3);")
#(((1 "/foo.drv") (2 "/bar.drv") (3 "/baz.drv")) ;ascending order
((3 "/baz.drv") (2 "/bar.drv") (1 "/foo.drv")) ;descending order
((3 "/baz.drv") (2 "/bar.drv") (1 "/foo.drv")) ;ditto
- ((3 "/baz.drv") (2 "/bar.drv") (1 "/foo.drv")) ;ditto
((3 "/baz.drv")) ;nr = 1
((2 "/bar.drv") (1 "/foo.drv") (3 "/baz.drv"))) ;status+submission-time
(with-temporary-database db
@@ -185,9 +185,7 @@ INSERT INTO Evaluations (specification, revision) VALUES (3, 3);")
(assq-ref alist #:derivation)))))
(vector (map summarize (db-get-builds db '((nr 3) (order build-id))))
(map summarize (db-get-builds db '()))
- (map summarize (db-get-builds db '((project "guix"))))
- (map summarize (db-get-builds db '((project "guix")
- (jobset "master"))))
+ (map summarize (db-get-builds db '((jobset "guix"))))
(map summarize (db-get-builds db '((nr 1))))
(map summarize
(db-get-builds db '((order status+submission-time))))))))
diff --git a/tests/http.scm b/tests/http.scm
index 9d460b2..ba53887 100644
--- a/tests/http.scm
+++ b/tests/http.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of Cuirass.
;;;
@@ -76,8 +77,7 @@
(define build-query-result
'((#:id . 1)
- (#:project . "guix")
- (#:jobset . "master")
+ (#:jobset . "guix")
(#:job . "fake-job")
(#:timestamp . 1501347493)
(#:starttime . 1501347493)
@@ -226,13 +226,13 @@
500
(response-code (http-get (test-cuirass-uri "/api/latestbuilds"))))
- (test-assert "/api/latestbuilds?nr=1&project=guix&jobset=master"
+ (test-assert "/api/latestbuilds?nr=1&jobset=guix"
(let ((hash-list
(call-with-input-string
(utf8->string
(http-get-body
(test-cuirass-uri
- "/api/latestbuilds?nr=1&project=guix&jobset=master")))
+ "/api/latestbuilds?nr=1&jobset=guix")))
json->scm)))
(and (= (length hash-list) 1)
(hash-table=?
@@ -241,14 +241,14 @@
(object->json-string build-query-result)
json->scm)))))
- (test-assert "/api/latestbuilds?nr=1&project=gnu"
+ (test-assert "/api/latestbuilds?nr=1&jobset=gnu"
;; The result should be an empty JSON array.
(let ((hash-list
(call-with-input-string
(utf8->string
(http-get-body
(test-cuirass-uri
- "/api/latestbuilds?nr=1&project=gnu")))
+ "/api/latestbuilds?nr=1&jobset=gnu")))
json->scm)))
(= (length hash-list) 0)))