bec/ci/Dockerfile.run_pytest

38 lines
1.2 KiB
Docker

# set base image (host OS)
ARG PY_VERSION=3.10 CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX
FROM $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:${PY_VERSION}
ARG BEC_SERVICE=bec_ipython_client OPHYD_DEVICES_BRANCH=main BEC_CORE_BRANCH=main
RUN echo "Building ${BEC_SERVICE} with Ophyd branch ${OPHYD_DEVICES_BRANCH} and Bec branch ${BEC_CORE_BRANCH}"
RUN apt update
RUN apt install redis -y
RUN apt install git -y
# set the working directory in the container
WORKDIR /code
# clone the bec repo
RUN git clone --branch ${BEC_CORE_BRANCH} https://gitlab.psi.ch/bec/bec.git
RUN mkdir /code/bec/test_files
ENV OPHYD_DEVICES_PATH=/code/bec/ophyd_devices
WORKDIR /code/bec
RUN git clone --branch ${OPHYD_DEVICES_BRANCH} https://gitlab.psi.ch/bec/ophyd_devices
WORKDIR /code/bec/ophyd_devices
RUN pip install -e .
WORKDIR /code/bec/
RUN pip install -e pytest_bec_e2e
RUN pip install -e bec_server[dev]
RUN pip install -e bec_ipython_client[dev]
RUN pip install -e bec_lib[dev]
WORKDIR /code/bec/${BEC_SERVICE}
# command to run on container start
ENTRYPOINT ["pytest", "--files-path", "/code/bec/test_files", "--start-servers", "--flush-redis", "-v", "--random-order", "--maxfail=2", "./tests/end-2-end"]