tests: all 16 tests now sourced from org (doctor→diagnostics rename, orphaned tests adopted)
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
This commit is contained in:
@@ -15,12 +15,13 @@
|
|||||||
#:stop-daemon
|
#:stop-daemon
|
||||||
#:log-message
|
#:log-message
|
||||||
#:main
|
#:main
|
||||||
#:doctor-run-all
|
#:diagnostics-run-all
|
||||||
#:doctor-main
|
#:diagnostics-main
|
||||||
#:doctor-check-dependencies
|
#:diagnostics-dependencies-check
|
||||||
#:doctor-check-env
|
#:diagnostics-env-check
|
||||||
#:register-provider
|
#:register-provider
|
||||||
#:system-ready-p
|
#:provider-openai-request
|
||||||
|
#:system-ready-p
|
||||||
#:run-setup-wizard
|
#:run-setup-wizard
|
||||||
#:skill-gateway-register
|
#:skill-gateway-register
|
||||||
#:skill-gateway-link
|
#:skill-gateway-link
|
||||||
@@ -242,7 +243,7 @@
|
|||||||
(format t "┌─────────────────────────────────────────────┐~%")
|
(format t "┌─────────────────────────────────────────────┐~%")
|
||||||
(format t "│ ERROR: ~A~%" (type-of condition))
|
(format t "│ ERROR: ~A~%" (type-of condition))
|
||||||
(format t "│~%")
|
(format t "│~%")
|
||||||
(format t "│ Run: passepartout doctor~%")
|
(format t "│ Run: passepartout diagnostics~%")
|
||||||
(format t "│ For system diagnostics~%")
|
(format t "│ For system diagnostics~%")
|
||||||
(format t "└─────────────────────────────────────────────┘~%")
|
(format t "└─────────────────────────────────────────────┘~%")
|
||||||
(format t "~%")
|
(format t "~%")
|
||||||
|
|||||||
@@ -88,8 +88,8 @@
|
|||||||
(format t "==================================================~%")
|
(format t "==================================================~%")
|
||||||
(handler-case
|
(handler-case
|
||||||
(progn
|
(progn
|
||||||
(when (fboundp 'doctor-run-all)
|
(when (fboundp 'diagnostics-run-all)
|
||||||
(let ((result (doctor-run-all :auto-install nil)))
|
(let ((result (diagnostics-run-all :auto-install nil)))
|
||||||
(setf *health-check-ran* t)
|
(setf *health-check-ran* t)
|
||||||
(if result
|
(if result
|
||||||
(progn
|
(progn
|
||||||
@@ -98,10 +98,10 @@
|
|||||||
(progn
|
(progn
|
||||||
(setf *system-health* :degraded)
|
(setf *system-health* :degraded)
|
||||||
(format t "DAEMON: Health check found issues.~%")
|
(format t "DAEMON: Health check found issues.~%")
|
||||||
(format t " Run 'passepartout doctor --fix' to repair.~%")))))
|
(format t " Run 'passepartout diagnostics' to repair.~%")))))
|
||||||
(setf *health-check-ran* t))
|
(setf *health-check-ran* t))
|
||||||
(error (c)
|
(error (c)
|
||||||
(format t "DOCTOR ERROR: ~a~%" c)
|
(format t "DIAGNOSTICS ERROR: ~a~%" c)
|
||||||
(setf *system-health* :unhealthy)
|
(setf *system-health* :unhealthy)
|
||||||
(setf *health-check-ran* t)))
|
(setf *health-check-ran* t)))
|
||||||
(format t "==================================================~%~%"))
|
(format t "==================================================~%~%"))
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
(actuator-initialize)
|
(actuator-initialize)
|
||||||
(skill-initialize-all)
|
(skill-initialize-all)
|
||||||
|
|
||||||
;; Run proactive doctor before starting services
|
;; Run proactive diagnostics before starting services
|
||||||
(diagnostics-startup-run)
|
(diagnostics-startup-run)
|
||||||
|
|
||||||
(heartbeat-start)
|
(heartbeat-start)
|
||||||
|
|||||||
@@ -162,4 +162,4 @@
|
|||||||
(redraw sw cw ch iw)
|
(redraw sw cw ch iw)
|
||||||
(refresh scr)
|
(refresh scr)
|
||||||
(sleep 0.03))
|
(sleep 0.03))
|
||||||
(disconnect-daemon))))
|
(disconnect-daemon))))
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
(in-package :passepartout)
|
||||||
|
|
||||||
(defvar *diagnostics-binaries* '("sbcl" "emacs" "git" "socat" "nc")
|
(defvar *diagnostics-binaries* '("sbcl" "emacs" "git" "socat" "nc")
|
||||||
"List of external binaries required for full system operation.")
|
"List of external binaries required for full system operation.")
|
||||||
|
|
||||||
|
|||||||
@@ -40,12 +40,13 @@ The package definition. All public symbols are exported here.
|
|||||||
#:stop-daemon
|
#:stop-daemon
|
||||||
#:log-message
|
#:log-message
|
||||||
#:main
|
#:main
|
||||||
#:doctor-run-all
|
#:diagnostics-run-all
|
||||||
#:doctor-main
|
#:diagnostics-main
|
||||||
#:doctor-check-dependencies
|
#:diagnostics-dependencies-check
|
||||||
#:doctor-check-env
|
#:diagnostics-env-check
|
||||||
#:register-provider
|
#:register-provider
|
||||||
#:system-ready-p
|
#:provider-openai-request
|
||||||
|
#:system-ready-p
|
||||||
#:run-setup-wizard
|
#:run-setup-wizard
|
||||||
#:skill-gateway-register
|
#:skill-gateway-register
|
||||||
#:skill-gateway-link
|
#:skill-gateway-link
|
||||||
@@ -304,7 +305,7 @@ Friendly error handler that replaces the raw SBCL debugger with a diagnostic mes
|
|||||||
(format t "┌─────────────────────────────────────────────┐~%")
|
(format t "┌─────────────────────────────────────────────┐~%")
|
||||||
(format t "│ ERROR: ~A~%" (type-of condition))
|
(format t "│ ERROR: ~A~%" (type-of condition))
|
||||||
(format t "│~%")
|
(format t "│~%")
|
||||||
(format t "│ Run: passepartout doctor~%")
|
(format t "│ Run: passepartout diagnostics~%")
|
||||||
(format t "│ For system diagnostics~%")
|
(format t "│ For system diagnostics~%")
|
||||||
(format t "└─────────────────────────────────────────────┘~%")
|
(format t "└─────────────────────────────────────────────┘~%")
|
||||||
(format t "~%")
|
(format t "~%")
|
||||||
|
|||||||
@@ -225,8 +225,8 @@ This is the "fail open" principle applied to boot: the system should start even
|
|||||||
(format t "==================================================~%")
|
(format t "==================================================~%")
|
||||||
(handler-case
|
(handler-case
|
||||||
(progn
|
(progn
|
||||||
(when (fboundp 'doctor-run-all)
|
(when (fboundp 'diagnostics-run-all)
|
||||||
(let ((result (doctor-run-all :auto-install nil)))
|
(let ((result (diagnostics-run-all :auto-install nil)))
|
||||||
(setf *health-check-ran* t)
|
(setf *health-check-ran* t)
|
||||||
(if result
|
(if result
|
||||||
(progn
|
(progn
|
||||||
@@ -235,10 +235,10 @@ This is the "fail open" principle applied to boot: the system should start even
|
|||||||
(progn
|
(progn
|
||||||
(setf *system-health* :degraded)
|
(setf *system-health* :degraded)
|
||||||
(format t "DAEMON: Health check found issues.~%")
|
(format t "DAEMON: Health check found issues.~%")
|
||||||
(format t " Run 'passepartout doctor --fix' to repair.~%")))))
|
(format t " Run 'passepartout diagnostics' to repair.~%")))))
|
||||||
(setf *health-check-ran* t))
|
(setf *health-check-ran* t))
|
||||||
(error (c)
|
(error (c)
|
||||||
(format t "DOCTOR ERROR: ~a~%" c)
|
(format t "DIAGNOSTICS ERROR: ~a~%" c)
|
||||||
(setf *system-health* :unhealthy)
|
(setf *system-health* :unhealthy)
|
||||||
(setf *health-check-ran* t)))
|
(setf *health-check-ran* t)))
|
||||||
(format t "==================================================~%~%"))
|
(format t "==================================================~%~%"))
|
||||||
@@ -272,7 +272,7 @@ Boot sequence:
|
|||||||
(actuator-initialize)
|
(actuator-initialize)
|
||||||
(skill-initialize-all)
|
(skill-initialize-all)
|
||||||
|
|
||||||
;; Run proactive doctor before starting services
|
;; Run proactive diagnostics before starting services
|
||||||
(diagnostics-startup-run)
|
(diagnostics-startup-run)
|
||||||
|
|
||||||
(heartbeat-start)
|
(heartbeat-start)
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ Note: not every harness or skill file has a corresponding test file. Tests exist
|
|||||||
(:file "tests/programming-lisp-tests")
|
(:file "tests/programming-lisp-tests")
|
||||||
(:file "tests/boot-sequence-tests")
|
(:file "tests/boot-sequence-tests")
|
||||||
(:file "tests/model-explorer-tests")
|
(:file "tests/model-explorer-tests")
|
||||||
|
(:file "tests/diagnostics-tests")
|
||||||
(:file "tests/tui-tests")
|
(:file "tests/tui-tests")
|
||||||
(:file "tests/llm-gateway-tests")
|
(:file "tests/llm-gateway-tests")))
|
||||||
(:file "tests/doctor-tests")))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** TUI System
|
** TUI System
|
||||||
|
|||||||
@@ -180,5 +180,30 @@ Event handlers + daemon I/O + main loop.
|
|||||||
(redraw sw cw ch iw)
|
(redraw sw cw ch iw)
|
||||||
(refresh scr)
|
(refresh scr)
|
||||||
(sleep 0.03))
|
(sleep 0.03))
|
||||||
(disconnect-daemon))))
|
(disconnect-daemon))))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
* Test Suite
|
||||||
|
#+begin_src lisp :tangle ../tests/tui-tests.lisp
|
||||||
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
|
(ql:quickload :fiveam :silent t))
|
||||||
|
|
||||||
|
(defpackage :passepartout-tui-tests
|
||||||
|
(:use :cl :passepartout)
|
||||||
|
(:export #:tui-suite))
|
||||||
|
|
||||||
|
(in-package :passepartout-tui-tests)
|
||||||
|
|
||||||
|
(fiveam:def-suite tui-suite :description "Verification of the TUI parsing and styling logic")
|
||||||
|
(fiveam:in-suite tui-suite)
|
||||||
|
|
||||||
|
(fiveam:test test-tui-connection-drop
|
||||||
|
"Tier 2 Chaos: Verify that handle-return degrades gracefully when the daemon connection is lost."
|
||||||
|
(let ((passepartout.gateway-tui::*incoming-msgs* nil)
|
||||||
|
(passepartout.gateway-tui::*input-buffer* (make-array 5 :element-type 'character :initial-contents "hello" :fill-pointer 5 :adjustable t))
|
||||||
|
(mock-stream (make-string-output-stream)))
|
||||||
|
(close mock-stream)
|
||||||
|
(passepartout.gateway-tui::handle-return mock-stream)
|
||||||
|
(fiveam:is (member "ERROR: Connection to daemon lost." passepartout.gateway-tui::*incoming-msgs* :test #'string=))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ Binary detection must use shell probing (`which`) to account for varying `$PATH`
|
|||||||
|
|
||||||
* Phase C: Implementation (Build)
|
* Phase C: Implementation (Build)
|
||||||
|
|
||||||
|
** Package Context
|
||||||
|
#+begin_src lisp
|
||||||
|
(in-package :passepartout)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** Global Configuration
|
** Global Configuration
|
||||||
;; REPL-VERIFIED: 2026-05-03T13:00:00
|
;; REPL-VERIFIED: 2026-05-03T13:00:00
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
@@ -238,24 +243,34 @@ The doctor checks all supported LLM providers and detects local Ollama instances
|
|||||||
|
|
||||||
* Phase D: Verification (Testing)
|
* Phase D: Verification (Testing)
|
||||||
|
|
||||||
** Dependency Test
|
#+begin_src lisp :tangle ../tests/diagnostics-tests.lisp
|
||||||
#+begin_src lisp :tangle no
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
(test test-doctor-dependency-check
|
(ql:quickload :fiveam :silent t))
|
||||||
|
|
||||||
|
(defpackage :passepartout-diagnostics-tests
|
||||||
|
(:use :cl :fiveam :passepartout)
|
||||||
|
(:export #:diagnostics-suite))
|
||||||
|
|
||||||
|
(in-package :passepartout-diagnostics-tests)
|
||||||
|
|
||||||
|
(def-suite diagnostics-suite :description "Verification of the System Diagnostics logic")
|
||||||
|
(in-suite diagnostics-suite)
|
||||||
|
|
||||||
|
(test test-diagnostics-dependency-fail
|
||||||
"Verify that missing binaries are correctly identified as failures."
|
"Verify that missing binaries are correctly identified as failures."
|
||||||
(let ((passepartout::*diagnostics-binaries* '("non-existent-binary-123")))
|
(let ((passepartout::*diagnostics-binaries* '("non-existent-binary-123")))
|
||||||
(is (null (passepartout:diagnostics-dependencies-check)))))
|
(is (null (diagnostics-dependencies-check)))))
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Environment Test
|
(test test-diagnostics-env-fail
|
||||||
#+begin_src lisp :tangle no
|
|
||||||
(test test-doctor-env-check
|
|
||||||
"Verify that an invalid MEMEX_DIR triggers a critical failure."
|
"Verify that an invalid MEMEX_DIR triggers a critical failure."
|
||||||
(let ((old-m (uiop:getenv "MEMEX_DIR")))
|
(let ((old-m (uiop:getenv "MEMEX_DIR"))
|
||||||
|
(old-d (uiop:getenv "PASSEPARTOUT_DATA_DIR")))
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
(setf (uiop:getenv "MEMEX_DIR") "/non/existent/path/999")
|
(setf (uiop:getenv "MEMEX_DIR") "/non/existent/path/999")
|
||||||
(is (null (passepartout:diagnostics-env-check))))
|
(is (null (diagnostics-env-check))))
|
||||||
(setf (uiop:getenv "MEMEX_DIR") (or old-m "")))))
|
(setf (uiop:getenv "MEMEX_DIR") (or old-m ""))
|
||||||
|
(setf (uiop:getenv "PASSEPARTOUT_DATA_DIR") (or old-d "")))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Phase E: Lifecycle
|
* Phase E: Lifecycle
|
||||||
|
|||||||
@@ -161,3 +161,23 @@ If API-KEY is nil, reads from environment."
|
|||||||
:priority 50
|
:priority 50
|
||||||
:trigger (lambda (ctx) (declare (ignore ctx)) nil))
|
:trigger (lambda (ctx) (declare (ignore ctx)) nil))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
* Test Suite
|
||||||
|
#+begin_src lisp :tangle ../tests/llm-gateway-tests.lisp
|
||||||
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
|
(ql:quickload :fiveam :silent t))
|
||||||
|
|
||||||
|
(defpackage :passepartout-llm-gateway-tests
|
||||||
|
(:use :cl :passepartout)
|
||||||
|
(:export #:llm-gateway-suite))
|
||||||
|
|
||||||
|
(in-package :passepartout-llm-gateway-tests)
|
||||||
|
|
||||||
|
(fiveam:def-suite llm-gateway-suite :description "Tests for the LLM provider backend")
|
||||||
|
(fiveam:in-suite llm-gateway-suite)
|
||||||
|
|
||||||
|
(fiveam:test test-provider-rejects-bad-keyword
|
||||||
|
"Verify that provider-openai-request returns :error for an unregistered provider."
|
||||||
|
(let ((result (provider-openai-request "hello" "test" :provider :not-a-real-provider)))
|
||||||
|
(fiveam:is (eq (getf result :status) :error))))
|
||||||
|
#+end_src
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
(:file "tests/programming-lisp-tests")
|
(:file "tests/programming-lisp-tests")
|
||||||
(:file "tests/boot-sequence-tests")
|
(:file "tests/boot-sequence-tests")
|
||||||
(:file "tests/model-explorer-tests")
|
(:file "tests/model-explorer-tests")
|
||||||
|
(:file "tests/diagnostics-tests")
|
||||||
(:file "tests/tui-tests")
|
(:file "tests/tui-tests")
|
||||||
(:file "tests/llm-gateway-tests")
|
(:file "tests/llm-gateway-tests")))
|
||||||
(:file "tests/doctor-tests")))
|
|
||||||
|
|
||||||
(defsystem :passepartout/tui
|
(defsystem :passepartout/tui
|
||||||
:depends-on (:passepartout :croatoan :usocket :bordeaux-threads)
|
:depends-on (:passepartout :croatoan :usocket :bordeaux-threads)
|
||||||
|
|||||||
Reference in New Issue
Block a user