[consfigurator] which package is *CONSFIG*

Yehouda Harpaz yeh at lispworks.com
Tue Dec 7 11:31:32 GMT 2021


Currently, just quickloading consfigurator/tests and running the tests
fail with errors (see below). The actual errors are called from the
init-form of the slot SYSTEMS in the PROPSPEC class
("src/propspec.lisp"), because the FIND-SYMBOL call returns nil. 

FIND-SYMBOL returns nil because *CONSFIG* is defined by the call to
IN-CONSFIG in "tests/property/file.lisp" in the package
"CONSFIGURATOR/TESTS", but when FIND-SYMBOL is called the package is
"CL-USER".

in general, relying on the value of the cucrrent package is qa bad
idea, unless you explictly set it up. 

If the same running process can have only one "consfiguration", than
*CONSFIG* can simply be in "CONSFIGURATOR" package. Otherwise, the
DEPLOY macro and friends need a way to specify which "consfiguration"
to use, and the test should use it (and document it). 



----------------------------------------------


CL-USER 4 > (ql:quickload "consfigurator/tests")
.......

CL-USER 5 > (RTEST:DO-TESTS)
Doing 3 pending tests of 3 tests total.
Test CONSFIGURATOR/TESTS::CONTAINS-CONF-SPACE failed
Form: (UIOP/STREAM:WITH-TEMPORARY-FILE (:PATHNAME CONSFIGURATOR/TESTS::TEMP) (WITH-OPEN-FILE (CONSFIGURATOR/TESTS::S CONSFIGURATOR/TESTS::TEMP :IF-EXISTS :SUPERSEDE :DIRECTION :OUTPUT) (WRITE-SEQUENCE "foo bar

# one two
one three
# one three
" CONSFIGURATOR/TESTS::S)) (CONSFIGURATOR:DEPLOY-THESE :LOCAL "localhost" (CONSFIGURATOR:EVALS (SYSTEM::BQ-LIST* (QUOTE CONSFIGURATOR.PROPERTY.FILE:CONTAINS-CONF-SPACE) CONSFIGURATOR/TESTS::TEMP (QUOTE ("foo" "baz" "one" "four" "two" "five"))))) (UIOP/STREAM:READ-FILE-STRING CONSFIGURATOR/TESTS::TEMP))
Expected value: "foo baz

one four
# one three
# one three
two five
"
Actual value: #<SIMPLE-ERROR 40101547FB>.
Test CONSFIGURATOR/TESTS::CONTAINS-CONF-SHELL failed
Form: (UIOP/STREAM:WITH-TEMPORARY-FILE (:PATHNAME CONSFIGURATOR/TESTS::TEMP) (WITH-OPEN-FILE (CONSFIGURATOR/TESTS::S CONSFIGURATOR/TESTS::TEMP :IF-EXISTS :SUPERSEDE :DIRECTION :OUTPUT) (WRITE-SEQUENCE "foo=\"bar baz\"

# bar=baz
other=\"three word s\"
" CONSFIGURATOR/TESTS::S)) (CONSFIGURATOR:DEPLOY-THESE :LOCAL "localhost" (CONSFIGURATOR:EVALS (SYSTEM::BQ-LIST* (QUOTE CONSFIGURATOR.PROPERTY.FILE:CONTAINS-CONF-SHELL) CONSFIGURATOR/TESTS::TEMP (QUOTE ("bar" "two words" "quux" "one" "other" "one"))))) (UIOP/STREAM:READ-FILE-STRING CONSFIGURATOR/TESTS::TEMP))
Expected value: "foo=\"bar baz\"

bar=\"two words\"
other=one
quux=one
"
Actual value: #<SIMPLE-ERROR 4010169713>.
Test CONSFIGURATOR/TESTS::CONTAINS-INI-SETTINGS failed
Form: (UIOP/STREAM:WITH-TEMPORARY-FILE (:PATHNAME CONSFIGURATOR/TESTS::TEMP) (WITH-OPEN-FILE (CONSFIGURATOR/TESTS::S CONSFIGURATOR/TESTS::TEMP :IF-EXISTS :SUPERSEDE :DIRECTION :OUTPUT) (WRITE-SEQUENCE "[one]
two=three

[other]
; bar = ba
bar = baz baz quux
" CONSFIGURATOR/TESTS::S)) (CONSFIGURATOR:DEPLOY-THESE :LOCAL "localhost" (CONSFIGURATOR:EVALS (SYSTEM::BQ-LIST* (QUOTE CONSFIGURATOR.PROPERTY.FILE:CONTAINS-INI-SETTINGS) CONSFIGURATOR/TESTS::TEMP (QUOTE ((QUOTE ("one" "four" "five")) (QUOTE ("another" "k" "v")) (QUOTE ("other" "bar" "baz")) (QUOTE ("another" "key" "val")) (QUOTE ("finally" "this" "one"))))))) (UIOP/STREAM:READ-FILE-STRING CONSFIGURATOR/TESTS::TEMP))
Expected value: "[one]
two=three
four=five

[other]
bar=baz
# bar=baz baz quux

[another]
k=v
key=val

[finally]
this=one
"
Actual value: #<SIMPLE-ERROR 401017B06B>.
3 out of 3 total tests failed: CONSFIGURATOR/TESTS::CONTAINS-CONF-SPACE, 
   CONSFIGURATOR/TESTS::CONTAINS-CONF-SHELL, 
   CONSFIGURATOR/TESTS::CONTAINS-INI-SETTINGS.
NIL

CL-USER 6 > (apropos "*CONSFIG*")
CONSFIGURATOR/TESTS::*CONSFIG*, value: ("consfigurator/tests")
CONSFIGURATOR::WITH-*HOST*-*CONSFIG* (defined macro)

CL-USER 7 > 



More information about the sgo-software-discuss mailing list