Skip to content

Commit 17ce56e

Browse files
committed
feat: rework tests
Create an image to run tests rather than binding the host tests folder fix #1209
1 parent 03f40a0 commit 17ce56e

File tree

17 files changed

+9
-2
lines changed

17 files changed

+9
-2
lines changed

build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ export DEVTOOLSET_ROOTPATH
6767
export PREPEND_PATH
6868
export LD_LIBRARY_PATH_ARG
6969

70+
MANYLINUX_IMAGE="quay.io/pypa/${POLICY}_${PLATFORM}:${COMMIT_SHA}"
71+
7072
BUILD_ARGS_COMMON=(
7173
"--platform=linux/${GOARCH}"
74+
"--pull=true"
7275
--build-arg POLICY --build-arg PLATFORM --build-arg BASEIMAGE
7376
--build-arg DEVTOOLSET_ROOTPATH --build-arg PREPEND_PATH --build-arg LD_LIBRARY_PATH_ARG
74-
--rm -t "quay.io/pypa/${POLICY}_${PLATFORM}:${COMMIT_SHA}"
77+
--rm -t "${MANYLINUX_IMAGE}"
7578
-f docker/Dockerfile docker/
7679
)
7780

@@ -85,9 +88,11 @@ if [ "${CI:-}" == "true" ]; then
8588
fi
8689

8790
USE_LOCAL_CACHE=0
91+
TEST_COMMAND="docker"
8892
if [ "${MANYLINUX_BUILD_FRONTEND}" == "docker" ]; then
8993
docker build "${BUILD_ARGS_COMMON[@]}"
9094
elif [ "${MANYLINUX_BUILD_FRONTEND}" == "podman" ]; then
95+
TEST_COMMAND="podman"
9196
podman build "${BUILD_ARGS_COMMON[@]}"
9297
elif [ "${MANYLINUX_BUILD_FRONTEND}" == "docker-buildx" ]; then
9398
USE_LOCAL_CACHE=1
@@ -101,7 +106,7 @@ else
101106
exit 1
102107
fi
103108

104-
docker run --rm -v "$(pwd)/tests:/tests:ro" "quay.io/pypa/${POLICY}_${PLATFORM}:${COMMIT_SHA}" /tests/run_tests.sh
109+
${TEST_COMMAND} run --rm "${MANYLINUX_IMAGE}" /opt/_internal/tests/run_tests.sh
105110

106111
if [ ${USE_LOCAL_CACHE} -ne 0 ]; then
107112
if [ -d "$(pwd)/.buildx-cache-${POLICY}_${PLATFORM}" ]; then

docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ RUN --mount=type=bind,target=/build_cpython38,from=build_cpython38 \
169169
manylinux-entrypoint /opt/_internal/build_scripts/finalize.sh \
170170
pp310-pypy310_pp73 pp311-pypy311_pp73
171171

172+
COPY tests /opt/_internal/tests/
173+
172174
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
173175

174176
CMD ["/bin/bash"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)