Skip to content

Commit

Permalink
Make it easier to customize where test results are submitted. Introdu…
Browse files Browse the repository at this point in the history
…ced new slot agent.results-receiver which is a function of one argument - test-run. The default function stored there submits the test-run via our Google App Engine server.
  • Loading branch information
avodonosov committed Dec 10, 2012
1 parent ed88365 commit f740af8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions agent/agent.lisp
Expand Up @@ -17,16 +17,21 @@

;;; Agent implementation class
(defclass agent-impl (agent)
( ;; initial values for the base class slots
(work-dir :initform (default-work-dir))
;; own slots
(persistence :type persistence :accessor persistence)
((persistence :type persistence :accessor persistence)
(results-receiver :type (function (list)) ; function of one argument - test run
:accessor results-receiver)
(blobstore :accessor blobstore :initform (make-gae-blobstore))
(project-lister :type project-lister :accessor project-lister)
;; custom-lib-world may be a plist in the form
;; (:directory <pathname designator> :id <string>)
(custom-lib-world :type list :accessor custom-lib-world :initform nil)))

(defmethod initialize-instance :after ((agent agent-impl) &key)
(setf (work-dir agent) (default-work-dir)
(results-receiver agent) (lambda (test-run)
(test-grid-blobstore:submit-run-info (blobstore agent)
test-run))))

(defmethod make-agent ()
(make-instance 'agent-impl))

Expand Down Expand Up @@ -235,8 +240,10 @@ the PREDICATE."
(make-run lib-world (implementation-identifier lisp)))
agent
lisp
(project-names (project-lister agent)))))
(submit-test-run-results (blobstore agent) results-dir)
;(project-names (project-lister agent))
'(:alexandria)
)))
(submit-test-run-results agent results-dir)
(mark-tested (persistence agent) lib-world (implementation-identifier lisp))
(cl-fad:delete-directory-and-files results-dir :if-does-not-exist :ignore)))
continue)))))
Expand Down
6 changes: 3 additions & 3 deletions agent/complete-test-run.lisp
Expand Up @@ -361,11 +361,11 @@ results in this directory are tested."
(save-run-info run-info test-run-dir)
run-info))

(defun submit-test-run-results (blobstore test-run-dir)
(defun submit-test-run-results (agent test-run-dir)
(log:info "Submitting the test results to the server from the directory ~S ..." (truename test-run-dir))
(let* ((run-info (submit-logs blobstore test-run-dir)))
(let* ((run-info (submit-logs (blobstore agent) test-run-dir)))
(log:info "The log files are submitted. Submitting the test run info...")
(test-grid-blobstore:submit-run-info blobstore run-info)
(funcall (results-receiver agent) run-info)
(log:info "Done. The test results are submitted. They will be reviewed by admin soon and added to the central database.")
run-info))

Expand Down

0 comments on commit f740af8

Please sign in to comment.