work in progress: more on steps and test-steps

This commit is contained in:
Helmut Merz 2024-06-06 10:49:52 +02:00
parent 86d05d5414
commit bf263cfb37
4 changed files with 22 additions and 20 deletions

View file

@ -12,10 +12,12 @@
(:file "forge/forge")
(:file "storage/storage")
(:file "storage/tracking" :depends-on ("storage/storage"))
(:file "steps/steps" :depends-on ("config" "forge/forge" "util"))
(:file "util")
(:file "testing" :depends-on ("util"))
(:file "test/test-config" :depends-on ("testing" "config"))
(:file "test/test-forge" :depends-on ("testing" "forge/forge"))
(:file "test/test-steps" :depends-on ("testing" "steps/steps"))
(:file "test/test-storage"
:depends-on ("testing" "storage/storage" "storage/tracking")))
:long-description "scopes: generic data processing facilities."
@ -26,9 +28,11 @@
(defsystem :scopes/test
:depends-on (:scopes)
:components ((:file "test/test-config")
(:file "test/test-steps")
(:file "test/test-storage")
(:file "test/test-forge"))
:perform (test-op (o c)
(symbol-call :scopes/test-config :run)
(symbol-call :scopes/test-storage :run-all)
(symbol-call :scopes/test-forge :run)))
(symbol-call :scopes/test-forge :run)
(symbol-call :scopes/test-steps :run)
(symbol-call :scopes/test-storage :run-all)))

View file

@ -1,8 +1,15 @@
;;;; cl-scopes/steps - here comes the real action
(defpackage :scopes/steps
(:use :common-lisp))
(:use :common-lisp)
(:local-nicknames (:config :scopes/config))
(:export #:config
#:name #:process))
(in-package :scopes/steps)
(defclass process () ())
(defclass config (config:base)
())
(defclass process ()
((name :initarg :name :reader name)))

View file

@ -3,6 +3,4 @@
(in-package :scopes/test-steps)
(setf *config*
(make-instance 'test-steps
:user "default-user"
:password "public"))
(make-instance 'steps:config))

View file

@ -12,22 +12,15 @@
(in-package :scopes/test-steps)
(defvar *config* nil)
(defclass test-steps (config:base)
((config:override-keys :initform '(user password))
(config:env-path :initform (t:test-path ".test.env"))
(user :initarg :user :reader user)
(password :initarg :password :reader password)))
(defvar *test-process* nil)
(defun run ()
(let ((*config* nil)
(t:*test-suite* (t:test-suite "steps")))
(setf (uiop:getenv "SCOPES_PASSWORD") "very_secret")
(t:*test-suite* (t:test-suite "steps"))
(*test-process* (make-instance 'steps:process :name "test-process")))
(load (t:test-path "config-steps" "etc"))
(test-make-path)
(test-send)
(t:show-result)))
(t:deftest test-make-path ()
;(format t "~&runtime-path (.env): ~s" (util:runtime-path ".env" "app"))
;(format t "~&home-path: ~s" (util:home-path ".env.txt" "lisp" "cl-scopes"))
(== (pathname-name (util:home-path ".env.txt" "lisp" "cl-scopes")) ".env"))
(t:deftest test-send ()
(== (steps:name *test-process*) "test-process"))