add bind mounts instead of copying files

This commit is contained in:
Sergey Dudoladov 2020-08-24 09:36:54 +02:00
parent e361ee83c5
commit 4945024899
3 changed files with 16 additions and 7 deletions

View File

@ -3,9 +3,12 @@
FROM ubuntu:18.04
LABEL maintainer="Team ACID @ Zalando <team-acid@zalando.de>"
COPY manifests ./manifests
COPY exec.sh ./exec.sh
COPY requirements.txt tests ./
#COPY manifests ./manifests
#COPY exec.sh ./exec.sh
#COPY requirements.txt tests ./
COPY requirements.txt ./
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
@ -20,7 +23,7 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ARG VERSION=dev
RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" ./__init__.py
#ARG VERSION=dev
#RUN sed -i "s/__version__ = .*/__version__ = '${VERSION}'/" /tests/__init__.py
CMD ["python3", "-m", "unittest", "discover", "--start-directory", ".", "-v"]

View File

@ -49,7 +49,13 @@ function set_kind_api_server_ip(){
function run_tests(){
docker run --rm --mount type=bind,source="$(readlink -f ${kubeconfig_path})",target=/root/.kube/config -e OPERATOR_IMAGE="${operator_image}" "${e2e_test_image}"
docker run --rm \
--mount type=bind,source="$(readlink -f ${kubeconfig_path})",target=/root/.kube/config \
--mount type=bind,source="$(readlink -f manifests)",target=/manifests \
--mount type=bind,source="$(readlink -f tests)",target=/tests \
--mount type=bind,source="$(readlink -f exec.sh)",target=/exec.sh \
-e OPERATOR_IMAGE="${operator_image}" "${e2e_test_image}"
}
function clean_up(){

View File

@ -646,7 +646,7 @@ class EndToEndTestCase(unittest.TestCase):
# wait a little before proceeding
time.sleep(10)
# add annotations to manifest
# add annotations to the postgresql object
deleteDate = datetime.today().strftime('%Y-%m-%d')
pg_patch_delete_annotations = {
"metadata": {