work in progress: set up steps package with tests
This commit is contained in:
		
							parent
							
								
									93443ae652
								
							
						
					
					
						commit
						86d05d5414
					
				
					 6 changed files with 52 additions and 6 deletions
				
			
		|  | @ -9,17 +9,21 @@ | ||||||
|   :depends-on (:alexandria :cl-dotenv :com.inuoe.jzon :local-time :log4cl :str) |   :depends-on (:alexandria :cl-dotenv :com.inuoe.jzon :local-time :log4cl :str) | ||||||
|   :components ((:file "config" :depends-on ("util")) |   :components ((:file "config" :depends-on ("util")) | ||||||
|                (:file "forge/forge") |                (:file "forge/forge") | ||||||
|  |                (:file "steps/steps" :depends-on ("config" "forge/forge" "util")) | ||||||
|                (:file "util") |                (:file "util") | ||||||
|                (:file "testing" :depends-on ("util")) |                (:file "testing" :depends-on ("util")) | ||||||
|                (:file "test/test-config" :depends-on ("testing" "config")) |                (: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." |   :long-description "scopes/core: The core packages of the scopes project." | ||||||
|   :in-order-to ((test-op (test-op "scopes-core/test")))) |   :in-order-to ((test-op (test-op "scopes-core/test")))) | ||||||
| 
 | 
 | ||||||
| (defsystem :scopes-core/test | (defsystem :scopes-core/test | ||||||
|   :depends-on (:scopes-core) |   :depends-on (:scopes-core) | ||||||
|   :components ((:file "test/test-config") |   :components ((:file "test/test-config") | ||||||
|                (:file "test/test-forge")) |                (:file "test/test-forge") | ||||||
|  |                (:file "test/test-steps")) | ||||||
|   :perform (test-op (o c)  |   :perform (test-op (o c)  | ||||||
|     (symbol-call :scopes/test-config :run) |     (symbol-call :scopes/test-config :run) | ||||||
|     (symbol-call :scopes/test-forge :run))) |     (symbol-call :scopes/test-forge :run) | ||||||
|  |     (symbol-call :scopes/test-steps :run))) | ||||||
|  |  | ||||||
|  | @ -5,4 +5,4 @@ | ||||||
| 
 | 
 | ||||||
| (in-package :scopes/steps) | (in-package :scopes/steps) | ||||||
| 
 | 
 | ||||||
| (defclass process ()) | (defclass process () ()) | ||||||
|  |  | ||||||
							
								
								
									
										8
									
								
								test/etc/config-steps.lisp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								test/etc/config-steps.lisp
									
										
									
									
									
										Normal file
									
								
							|  | @ -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")) | ||||||
|  | @ -21,7 +21,8 @@ | ||||||
|    (password :initarg :password :reader password))) |    (password :initarg :password :reader password))) | ||||||
| 
 | 
 | ||||||
| (defun run () | (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") |     (setf (uiop:getenv "SCOPES_PASSWORD") "very_secret") | ||||||
|     (load (t:test-path "config-dummy" "etc")) |     (load (t:test-path "config-dummy" "etc")) | ||||||
|     (test-make-path) |     (test-make-path) | ||||||
|  |  | ||||||
							
								
								
									
										33
									
								
								test/test-steps.lisp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								test/test-steps.lisp
									
										
									
									
									
										Normal file
									
								
							|  | @ -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")) | ||||||
|  | @ -7,7 +7,7 @@ | ||||||
|   (:export #:*test-suite* |   (:export #:*test-suite* | ||||||
|            #:test-suite #:deftest #:show-result |            #:test-suite #:deftest #:show-result | ||||||
|            #:test #:== |            #:test #:== | ||||||
|            #:test-path)) |            #:test-path #:*current-system*)) | ||||||
| 
 | 
 | ||||||
| (in-package :scopes/testing) | (in-package :scopes/testing) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue