From bf263cfb377dc184bf42db1189d20dff805294ed Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 6 Jun 2024 10:49:52 +0200 Subject: [PATCH] work in progress: more on steps and test-steps --- scopes.asd | 8 ++++++-- steps/steps.lisp | 11 +++++++++-- test/etc/config-steps.lisp | 4 +--- test/test-steps.lisp | 19 ++++++------------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/scopes.asd b/scopes.asd index af98815..cba900c 100644 --- a/scopes.asd +++ b/scopes.asd @@ -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))) diff --git a/steps/steps.lisp b/steps/steps.lisp index 4d696ee..62e0d4b 100644 --- a/steps/steps.lisp +++ b/steps/steps.lisp @@ -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))) diff --git a/test/etc/config-steps.lisp b/test/etc/config-steps.lisp index 10b5424..23cb5b8 100644 --- a/test/etc/config-steps.lisp +++ b/test/etc/config-steps.lisp @@ -3,6 +3,4 @@ (in-package :scopes/test-steps) (setf *config* - (make-instance 'test-steps - :user "default-user" - :password "public")) + (make-instance 'steps:config)) diff --git a/test/test-steps.lisp b/test/test-steps.lisp index faf4ea2..8bea1f9 100644 --- a/test/test-steps.lisp +++ b/test/test-steps.lisp @@ -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"))