Skip to content

Commit

Permalink
infra: add codecov.io support
Browse files Browse the repository at this point in the history
  • Loading branch information
cybergrind committed Jul 16, 2020
1 parent bd40675 commit 7da0997
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = aiozk/test/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ __pycache__
*~
*\#
venv
/coverage.xml
/.cache/
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ install:

script:
- ./test-runner.sh

after_success:
- pip3 install codecov
- codecov
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM fan0/python:2.1.0

WORKDIR /code

RUN pip3 install fan_tools pytest-asyncio asynctest
RUN pip3 install fan_tools pytest-asyncio asynctest pytest-cov codecov
RUN apt install -y tcpdump

ADD . /code
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ We've chosen `zookeeper 3.5` version since it has an ability to dynamic reconfig

```sh
# first terminal: launch zookeeper cluster
docker-compose rm -fv && docker-compose build zk && docker-compose scale zk=7 && docker-compose up zk_seed zk
docker-compose rm -fv && docker-compose build zk && docker-compose up --scale zk=7 zk_seed zk

# it will launch cluster in this terminal and remain. last lines should be like this:

Expand Down Expand Up @@ -148,7 +148,7 @@ zk_7 | Reconfiguring...
zk_7 | ethernal loop
```

Run tests:
Run tests in docker:

```sh
docker-compose run --no-deps aiozk
Expand All @@ -163,6 +163,12 @@ OK

```

Run tests locally:
```sh
# ZK_IP can be something from logs above, like: ZK_HOST=172.21.0.6:2181
ZK_HOST=<ZK_IP> ./venv/bin/pytest
```

### Recipes testing

It seems that usually recipes require several things to be tested:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:

aiozk:
build: .
command: /bin/bash -c 'python3 setup.py install && fan_wait zk 2181 && pytest'
command: /bin/bash -c 'python3 setup.py install && fan_wait zk 2181 && pytest --cov=aiozk --cov-config=.coveragerc && coverage xml'
environment:
- PYTHONPATH=.
volumes:
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
# addopts = --cov=aiozk --cov-config=.coveragerc
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'pytest',
'pytest-asyncio',
'asynctest',
'pytest-cov',
],
classifiers=[
'Development Status :: 3 - Alpha',
Expand Down

0 comments on commit 7da0997

Please sign in to comment.