mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
server/tests: integrate testing into Docker
This commit is contained in:
23
server/hooks/test
Executable file
23
server/hooks/test
Executable file
@ -0,0 +1,23 @@
|
||||
#!/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 pip3 install --no-cache-dir pytest-cov freezegun
|
||||
USER app
|
||||
ENV POSTGRES_HOST=x \
|
||||
POSTGRES_USER=x \
|
||||
POSTGRES_PASSWORD=x \
|
||||
ESEARCH_HOST=x
|
||||
CMD ["pytest", "szurubooru/", \
|
||||
"--cov-report=term-missing", "--cov=szurubooru", "--tb=short"]
|
||||
EOF
|
||||
|
||||
docker run --rm -t ${IMAGE_NAME}-test
|
Reference in New Issue
Block a user