diff --git a/scopes-core.asd b/scopes-core.asd index ee19135..2aeaae0 100644 --- a/scopes-core.asd +++ b/scopes-core.asd @@ -9,17 +9,21 @@ :depends-on (:alexandria :cl-dotenv :com.inuoe.jzon :local-time :log4cl :str) :components ((:file "config" :depends-on ("util")) (:file "forge/forge") + (: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-forge" :depends-on ("testing" "forge/forge")) + (:file "test/test-steps" :depends-on ("testing" "steps/steps"))) :long-description "scopes/core: The core packages of the scopes project." :in-order-to ((test-op (test-op "scopes-core/test")))) (defsystem :scopes-core/test :depends-on (:scopes-core) :components ((:file "test/test-config") - (:file "test/test-forge")) + (:file "test/test-forge") + (:file "test/test-steps")) :perform (test-op (o c) (symbol-call :scopes/test-config :run) - (symbol-call :scopes/test-forge :run))) + (symbol-call :scopes/test-forge :run) + (symbol-call :scopes/test-steps :run))) diff --git a/steps/steps.lisp b/steps/steps.lisp index 6c2a9fa..4d696ee 100644 --- a/steps/steps.lisp +++ b/steps/steps.lisp @@ -5,4 +5,4 @@ (in-package :scopes/steps) -(defclass process ()) +(defclass process () ()) diff --git a/test/etc/config-steps.lisp b/test/etc/config-steps.lisp new file mode 100644 index 0000000..10b5424 --- /dev/null +++ b/test/etc/config-steps.lisp @@ -0,0 +1,8 @@ +;;;; cl-scopes/test/etc/config-steps - configuration for `scopes-steps` tests + +(in-package :scopes/test-steps) + +(setf *config* + (make-instance 'test-steps + :user "default-user" + :password "public")) diff --git a/test/test-config.lisp b/test/test-config.lisp index c8b2ba2..8577623 100644 --- a/test/test-config.lisp +++ b/test/test-config.lisp @@ -21,7 +21,8 @@ (password :initarg :password :reader password))) (defun run () - (let ((t:*test-suite* (t:test-suite "config"))) + (let ((*config* nil) + (t:*test-suite* (t:test-suite "config"))) (setf (uiop:getenv "SCOPES_PASSWORD") "very_secret") (load (t:test-path "config-dummy" "etc")) (test-make-path) diff --git a/test/test-steps.lisp b/test/test-steps.lisp new file mode 100644 index 0000000..faf4ea2 --- /dev/null +++ b/test/test-steps.lisp @@ -0,0 +1,33 @@ +;;;; cl-scopes/test-steps - testing for the scopes-steps system. + +(defpackage :scopes/test-steps + (:use :common-lisp) + (:local-nicknames (:config :scopes/config) + (:steps :scopes/steps) + (:util :scopes/util) + (:t :scopes/testing)) + (:export #:run #:user #:password) + (:import-from :scopes/testing #:deftest #:==)) + +(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))) + +(defun run () + (let ((*config* nil) + (t:*test-suite* (t:test-suite "steps"))) + (setf (uiop:getenv "SCOPES_PASSWORD") "very_secret") + (load (t:test-path "config-steps" "etc")) + (test-make-path) + (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")) diff --git a/testing.lisp b/testing.lisp index b382f73..3334bb0 100644 --- a/testing.lisp +++ b/testing.lisp @@ -7,7 +7,7 @@ (:export #:*test-suite* #:test-suite #:deftest #:show-result #:test #:== - #:test-path)) + #:test-path #:*current-system*)) (in-package :scopes/testing)