Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

ch-test: build and unpack image only #1899

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

lucaudill
Copy link
Collaborator

closes #1748

@lucaudill lucaudill requested a review from reidpr July 29, 2024 21:19
@reidpr reidpr marked this pull request as draft July 29, 2024 21:20
Copy link
Collaborator

@reidpr reidpr left a 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"
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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
Copy link
Collaborator

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)
Copy link
Collaborator

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?

@lucaudill lucaudill mentioned this pull request Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add test feature that builds and unpacks one image
2 participants