File tree Expand file tree Collapse file tree 4 files changed +32
-11
lines changed Expand file tree Collapse file tree 4 files changed +32
-11
lines changed Original file line number Diff line number Diff line change 33tags
44* .egg-info
55Dockerfile
6+ .coverage
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ services:
66 - docker
77
88install :
9- - sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile.tmpl > Dockerfile
9+ - sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile.tmpl > Dockerfile
1010 - docker-compose build
1111
1212script :
13- - docker-compose run tests
13+ - docker-compose run $(bash <(curl -s https://codecov.io/env)) tests
1414
1515notifications :
1616 email :
Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ FROM postgres:${PG_VERSION}-alpine
22
33ENV PYTHON=python${PYTHON_VERSION}
44RUN if [ "${PYTHON_VERSION}" = "2" ] ; then \
5- apk add --no-cache python py-pip; \
6- pip install six pg8000 flake8 port-for; \
5+ apk add --no-cache python2 py-virtualenv py-pip; \
76 fi
87RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
9- apk add --no-cache python3; \
10- pip3 install six pg8000 flake8 port-for; \
8+ apk add --no-cache python3 py-virtualenv; \
119 fi
1210ENV LANG=C.UTF-8
1311
@@ -18,7 +16,6 @@ RUN chmod 755 /run.sh
1816
1917ADD . /pg/testgres
2018WORKDIR /pg/testgres
21- RUN ${PYTHON} setup.py install
2219
2320USER postgres
2421ENTRYPOINT PYTHON=${PYTHON} /run.sh
Original file line number Diff line number Diff line change 22
33set -eux
44
5- cd testgres/tests
6- ${PYTHON} -m unittest test_simple
5+ if [ " $PYTHON_VERSION " -eq " 2" ]; then
6+ virtualenv=" virtualenv --python=/usr/bin/python2"
7+ pip=pip2
8+ else
9+ virtualenv=" virtualenv --python=/usr/bin/python3"
10+ pip=pip3
11+ fi
12+
13+ # prepare environment
14+ $virtualenv env
15+ source env/bin/activate
16+
17+ # install utilities
18+ $pip install coverage codecov flake8
19+
20+ # install testgres
21+ $pip install -U .
722
8- cd ../..
23+ # test code quality
924flake8 .
1025
11- cd ../..
26+ # run tests
27+ cd testgres/tests
28+ coverage run test_simple.py
29+
30+ # show coverage
31+ coverage report
32+
33+ # gather reports
34+ codecov
You can’t perform that action at this time.
0 commit comments