Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
clpm
clpm
Commits
9629d363
Commit
9629d363
authored
Oct 18, 2021
by
Eric Timmons
Browse files
Add test for
#44
that goes through the client
parent
d92df0cf
Pipeline
#5124
passed with stages
in 50 minutes and 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
clpm-test.asd
View file @
9629d363
...
...
@@ -11,7 +11,7 @@
:description
"Tests for CLPM"
:license
"BSD-2-Clause"
:pathname
"test/"
:depends-on
(
#:parachute
#:hunchentoot
#:alexandria
)
:depends-on
(
#:parachute
#:hunchentoot
#:alexandria
#:clpm-client
)
:serial
t
:components
((
:file
"package"
)
...
...
test/global-context.lisp
View file @
9629d363
...
...
@@ -3,7 +3,6 @@
(
para:define-test
global-context-editable-install
(
uiop:with-current-directory
((
asdf:system-relative-pathname
:clpm
"test/global-context/editable-install/"
))
(
with-clpm-env
(
:config-dir
:global
:data-dir
data-dir
)
;;(break "~S" data-dir)
(
clpm
'
(
"sync"
"-VV"
)
:output
:interactive
:error-output
:interactive
)
...
...
@@ -18,3 +17,16 @@
"--quit"
)
:output
:interactive
:error-output
:interactive
))))
(
para:define-test
global-context-editable-install-with-client
(
uiop:with-current-directory
((
asdf:system-relative-pathname
:clpm
"test/global-context/editable-install/"
))
(
let
((
*default-pathname-defaults*
(
uiop:getcwd
)))
(
with-clpm-env
(
:config-dir
:global
:data-dir
data-dir
)
(
clpm-client:sync
)
;; Ensure alexandria is installed as well.
(
flet
((
validate
(
diff
)
(
para:true
(
member
"alexandria"
(
clpm-client:context-diff-release-diffs
diff
)
:test
#'
equal
:key
'clpm-client:release-diff-project-name
))
t
))
(
clpm-client:install
:asds
'
(
"test.asd"
)
:validate
#'
validate
))))))
test/suite.lisp
View file @
9629d363
...
...
@@ -25,7 +25,31 @@
(
string-downcase
config-dir
)
"/"
))))
*clpm-env*
))
(
funcall
thunk
:cache-dir
cache-dir
:data-dir
data-dir
)))))
;; TODO: remove this. Instead of modifying the environment of this
;; process, we should add a set of arguments that let us set any config
;; option via the CLI and teach clpm-client how to use that.
(
let
((
orig-data-dir
(
or
(
uiop:getenvp
"CLPM_DATA_DIR"
)
""
))
(
orig-cache-dir
(
or
(
uiop:getenvp
"CLPM_CACHE_DIR"
)
""
))
(
orig-config-dirs
(
or
(
uiop:getenvp
"CLPM_CONFIG_DIRS"
)
""
))
(
orig-grovel-sandbox-type
(
or
(
uiop:getenvp
"CLPM_GROVEL_SANDBOX_TYPE"
)
""
)))
(
unwind-protect
(
progn
(
setf
(
uiop:getenv
"CLPM_DATA_DIR"
)
(
uiop:native-namestring
data-dir
)
(
uiop:getenv
"CLPM_CACHE_DIR"
)
(
uiop:native-namestring
cache-dir
)
(
uiop:getenv
"CLPM_GROVEL_SANDBOX_TYPE"
)
"nil"
)
(
when
(
keywordp
config-dir
)
(
setf
(
uiop:getenv
"CLPM_CONFIG_DIRS"
)
(
uiop:native-namestring
(
asdf:system-relative-pathname
:clpm
(
concatenate
'string
"test/configs/"
(
string-downcase
config-dir
)
"/"
)))))
(
funcall
thunk
:cache-dir
cache-dir
:data-dir
data-dir
))
(
setf
(
uiop:getenv
"CLPM_DATA_DIR"
)
orig-data-dir
(
uiop:getenv
"CLPM_CACHE_DIR"
)
orig-cache-dir
(
uiop:getenv
"CLPM_CONFIG_DIRS"
)
orig-config-dirs
(
uiop:getenv
"CLPM_GROVEL_SANDBOX_TYPE"
)
orig-grovel-sandbox-type
)))))))
(
defmacro
with-clpm-env
((
&key
(
cache-dir
(
gensym
))
(
data-dir
(
gensym
))
config-dir
)
&body
body
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment