Skip to content
Newer
Older
100644 52 lines (43 sloc) 2.13 KB
8674150 @avodonosov Added submit-last-day-results.lisp utility.
avodonosov authored
1 ;;;; An utility to help submitting test results after
2 ;;;; the Lisps where drakma doesn't work (today it doesn't work
3 ;;;; on several Lisps).
4 ;;;;
5 ;;;; After the test result submittion fails, we can run
6 ;;;; this utility on another Lisp, where drakma isn't broken
7 ;;;; and it submits all the test results for the last 24 horus
8 ;;;; which haven't been submitted yet.
9 ;;;;
10 ;;;; This code depends on cl-fad for file system operations,
11 ;;;; therefore we do not include it into test-grid.lisp,
12 ;;;; as we don't want test-grdid.lisp to depend on anything
e2cbdbb @avodonosov fixed typo in the comment
avodonosov authored
13 ;;;; other than ASDF and Quicklisp.
8674150 @avodonosov Added submit-last-day-results.lisp utility.
avodonosov authored
14
15 (let* ((this-file (load-time-value (or *load-truename* #.*compile-file-pathname*)))
16 (this-file-dir (make-pathname :directory (pathname-directory this-file))))
17 (pushnew this-file-dir asdf:*central-registry* :test #'equal))
18
19 (asdf:operate 'asdf:load-op :test-grid)
20
21 (ql:quickload "cl-fad")
22
23 (defun submitted-p (test-run-directory)
24 "Tests the specified TEST-RUN-DIRECTORY
25 whether the test results are submitted by examining
26 the rist lib-result in the test-run-info.lisp file
27 containing there and checking if the first lib-result here
28 has a blobstore key for the library log."
29 (let* ((run-info-file (test-grid::run-info-file test-run-directory))
30 (run-info (and (cl-fad:file-exists-p run-info-file)
31 (test-grid::safe-read-file run-info-file))))
32 (getf (first (getf run-info :results))
33 :log-blob-key)))
34
35 (defun submit-last-day-results ()
36 (let ((hour-ago-str (test-grid::fmt-time (- (get-universal-time)
37 #.(* 60 60 24))))
38 (submit-count 0))
39
40 (dolist (test-dir (cl-fad:list-directory (test-grid::test-output-base-dir)))
6f22e0d @avodonosov Some more loggint in submit-last-day-results.lisp
avodonosov authored
41 (let ((dir-name (file-namestring (cl-fad:pathname-as-file test-dir))))
42 (when (and (string> dir-name hour-ago-str)
43 (not (submitted-p test-dir)))
44 (format t "submitting ~A~%" test-dir)
45 (test-grid::submit-results test-dir)
46 (incf submit-count))))
8674150 @avodonosov Added submit-last-day-results.lisp utility.
avodonosov authored
47 (format t "~A test results submitted~%" submit-count)
48 submit-count))
49
50 (submit-last-day-results)
51
Something went wrong with that request. Please try again.