Skip to content

Commit 04dbeb2

Browse files
committed
Add test_image function
1 parent 3bfd15f commit 04dbeb2

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

test-build.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,31 @@ function build() {
4444
fatal "Build of ${full_tag} failed!"
4545
fi
4646
info "Build of ${full_tag} succeeded."
47+
}
48+
49+
function test_image() {
50+
local full_version
51+
local variant
52+
local tag
53+
local full_tag
54+
version="$1"
55+
shift
56+
variant="$1"
57+
shift
58+
tag="$1"
59+
shift
60+
61+
if [ -z "${variant}" ]; then
62+
full_tag="${tag}"
63+
elif [ "${variant}" = "default" ]; then
64+
full_tag="${tag}"
65+
else
66+
full_tag="${tag}-${variant}"
67+
fi
4768

4869
info "Testing ${full_tag}"
49-
export full_tag=${full_tag}
5070
export full_version=${full_version}
71+
export full_tag=${full_tag}
5172
bats test-image.bats
5273
}
5374

@@ -68,6 +89,7 @@ for version in "${versions[@]}"; do
6889
# Required for chakracore
6990
if [ -f "${version}/Dockerfile" ]; then
7091
build "${version}" "default" "${tag}"
92+
test_image "${full_version}" "default" "${tag}"
7193
fi
7294

7395
# Get supported variants according to the target architecture.
@@ -80,9 +102,11 @@ for version in "${versions[@]}"; do
80102

81103
if [ "${variant}" = "onbuild" ]; then
82104
build "${version}" "${default_variant}" "$tag"
105+
test_image "${full_version}" "${default_variant}" "$tag"
83106
fi
84107

85108
build "${version}" "${variant}" "${tag}"
109+
test_image "${full_version}" "${variant}" "${tag}"
86110
done
87111

88112
done

0 commit comments

Comments
 (0)