guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Implement the JSON representation for system test


From: Christopher Baines
Subject: branch master updated: Implement the JSON representation for system tests
Date: Sun, 27 Sep 2020 10:08:40 -0400

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 84907fe  Implement the JSON representation for system tests
84907fe is described below

commit 84907fe040b6cef0b738ac1acce9359720dfcc33
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Sep 27 12:06:18 2020 +0100

    Implement the JSON representation for system tests
---
 guix-data-service/web/revision/controller.scm | 17 ++++++++++++++++-
 guix-data-service/web/revision/html.scm       | 10 ++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/guix-data-service/web/revision/controller.scm 
b/guix-data-service/web/revision/controller.scm
index ec93c04..be6a4d0 100644
--- a/guix-data-service/web/revision/controller.scm
+++ b/guix-data-service/web/revision/controller.scm
@@ -423,7 +423,22 @@
            mime-types)
       ((application/json)
        (render-json
-        '()))                           ; TODO
+        `((commit . ,commit-hash)
+          (system . ,(assq-ref query-parameters 'system))
+          (system_tests
+           . ,(list->vector
+               (map
+                (match-lambda
+                  ((name description file line column-number
+                         derivation-file-name builds)
+                   `((name . ,name)
+                     (description . ,description)
+                     (location . ((file . ,file)
+                                  (line . ,line)
+                                  (column-number . ,column-number)))
+                     (derivation . ,derivation-file-name)
+                     (builds . ,(list->vector builds)))))
+                system-tests))))))
       (else
        (render-html
         #:sxml (view-revision-system-tests
diff --git a/guix-data-service/web/revision/html.scm 
b/guix-data-service/web/revision/html.scm
index 5917d50..32cd3ec 100644
--- a/guix-data-service/web/revision/html.scm
+++ b/guix-data-service/web/revision/html.scm
@@ -868,6 +868,16 @@
                     (button (@ (type "submit")
                                (class "btn btn-lg btn-primary"))
                             "Update results")))))
+        (a (@ (class "btn btn-lg btn-default pull-right")
+              (href ,(let ((query-parameter-string
+                            (query-parameters->string query-parameters)))
+                       (string-append
+                        path-base ".json"
+                        (if (string-null? query-parameter-string)
+                            ""
+                            (string-append "?" query-parameter-string)))))
+              (role "button"))
+           "View JSON")
         (table
          (@ (class "table"))
          (thead



reply via email to

[Prev in Thread] Current Thread [Next in Thread]