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 3
3
tags
4
4
* .egg-info
5
5
Dockerfile
6
+ .coverage
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ services:
6
6
- docker
7
7
8
8
install :
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
10
10
- docker-compose build
11
11
12
12
script :
13
- - docker-compose run tests
13
+ - docker-compose run $(bash <(curl -s https://codecov.io/env)) tests
14
14
15
15
notifications :
16
16
email :
Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ FROM postgres:${PG_VERSION}-alpine
2
2
3
3
ENV PYTHON=python${PYTHON_VERSION}
4
4
RUN 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; \
7
6
fi
8
7
RUN 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; \
11
9
fi
12
10
ENV LANG=C.UTF-8
13
11
@@ -18,7 +16,6 @@ RUN chmod 755 /run.sh
18
16
19
17
ADD . /pg/testgres
20
18
WORKDIR /pg/testgres
21
- RUN ${PYTHON} setup.py install
22
19
23
20
USER postgres
24
21
ENTRYPOINT PYTHON=${PYTHON} /run.sh
Original file line number Diff line number Diff line change 2
2
3
3
set -eux
4
4
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 .
7
22
8
- cd ../..
23
+ # test code quality
9
24
flake8 .
10
25
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