szurubooru/server/hooks/test
Shyam Sunder ea675d20cb server/docker: fix missing installation requirements
Furthermore, an update to Pillow has improved the floating-point
precision of the image hash algorithm, requiring minor updates to
the respective unit tests.

See https://github.com/python-pillow/Pillow/pull/4320
2020-06-04 16:38:26 -04:00

34 lines
598 B
Bash
Executable file

#!/bin/sh
set -e
docker build \
--build-arg BASE_IMAGE=${IMAGE_NAME} \
--file - \
--tag ${IMAGE_NAME}-test \
. <<'EOF'
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
WORKDIR /opt/app
USER root
RUN apk --no-cache add \
py3-pip \
py3-pytest \
py3-pytest-cov \
postgresql \
&& \
pip3 install \
--no-cache-dir \
--disable-pip-version-check \
pytest-pgsql \
freezegun
USER app
ENV POSTGRES_HOST=x \
POSTGRES_USER=x \
POSTGRES_PASSWORD=x
CMD ["pytest", "szurubooru/", \
"--cov-report=term-missing", "--cov=szurubooru", "--tb=short"]
EOF
docker run --rm -t ${IMAGE_NAME}-test
exit $?