Skip to content

Commit f119bc2

Browse files
committed
Fix tests
1 parent dc3d517 commit f119bc2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Dockerfile.tmpl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
FROM postgres:${PG_VERSION}-alpine
22

3+
ENV PYTHON=python${PYTHON_VERSION}
4+
RUN if [ "${PYTHON_VERSION}" = "2" ] ; then \
5+
apk add --no-cache python py-pip; \
6+
pip install six pg8000 flake8; \
7+
fi
8+
RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
9+
apk add --no-cache python3; \
10+
pip3 install six pg8000 flake8; \
11+
fi
312
ENV LANG=C.UTF-8
4-
RUN apk --no-cache add python${PYTHON_VERSION} py-pip
5-
RUN pip install six pg8000 flake8
613

714
RUN mkdir -p /pg
815
VOLUME /pg
@@ -11,6 +18,7 @@ RUN chmod 755 /run.sh
1118

1219
ADD . /pg/testgres
1320
WORKDIR /pg/testgres
14-
RUN python setup.py install
21+
RUN ${PYTHON} setup.py install
1522

16-
ENTRYPOINT su-exec postgres /run.sh
23+
USER postgres
24+
ENTRYPOINT PYTHON=${PYTHON} /run.sh

run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
22

33
cd testgres/tests
4-
python -m unittest test_simple
4+
${PYTHON} -m unittest test_simple
55
flake8 --ignore=W191,F401,E501,F403 .

0 commit comments

Comments
 (0)