-
Notifications
You must be signed in to change notification settings - Fork 60
ch-test
: build and unpack image only
#1899
base: master
Are you sure you want to change the base?
Conversation
…build_unpack_1748
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start. Some ideas in-line.
@@ -88,6 +88,8 @@ EOF | |||
|
|||
bats_vmin=1.2.0 # FIXME: get from configure somehow? | |||
|
|||
ch_build_unpack_all="argenv quick copy almalinux_8ch debian_11ch hello multistage seccomp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should derive this list from the tests we actually have; it should also be responsive to --scope
.
@@ -197,6 +199,9 @@ dir_tar_check_file () { | |||
for f in "$@"; do | |||
if [[ -f ${CH_TEST_TARDIR}/${f} ]]; then | |||
return 0 | |||
elif [[ "$f" == *"chtest"* ]] && [[ -n "$ch_build_unpack_list" ]]; then | |||
# chtest not needed for build-unpack phase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not true — why treat chtest
different from any other image?
@@ -945,6 +967,8 @@ while [[ $# -gt 0 ]]; do | |||
esac | |||
done | |||
|
|||
export ch_build_unpack_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subprocesses won't need this; are you sure it needs to be exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's my understanding that the export
is necessary for this variable to be available to other files, e.g. common.bash
, where we decide whether or not to skip a test. I'm basically copying what we do with ch_one_test
.
@@ -978,7 +1002,7 @@ if [[ $phase = one-file ]]; then | |||
fi | |||
|
|||
printf "%-21s %s" 'phase:' "$phase" | |||
if [[ $phase = one-file ]]; then | |||
if [[ $phase = one-file || $phase = build-unpack ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there's a reasonable way to make one-file interact with build-unpack. That is, rather than listing images with -i
, build-unpack builds and unpacks all images except if -f
is given. I think -f
does have some smarts about which tests indicate an image?
@@ -1168,6 +1192,24 @@ case $phase in | |||
test_build | |||
win | |||
;; | |||
build-unpack) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if rather than making build-unpack a phase, could it be a modifier on build and run? Or, perhaps there's a new phase unpack
, and build-unpack
implies build-images
and unpack
? Or, maybe build-images
goes away and is replaced by running build
with the build-unpack modifier?
closes #1748