Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test coverage measuring. See #207
  • Loading branch information
gribok committed Mar 29, 2020
commit d56cb32beef35ff976890941006e85b7faa8dfe2
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ python:
install:
- "pip install pipenv"
- "pipenv install --dev --skip-lock"
- "pipenv install coveralls"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this coveralls stuff should be a totally separate PR but...

You shouldn't use pipenv install this dependency here.

  1. Either add it to the Pipfile so that it gets installed along with the dev dependencies
  2. install it directly with pip in the first install step. pip install pipenv coveralls

script:
- "make test lint check-fmt"
- "make coverage-test lint check-fmt"
after_success:
- coveralls --verbose
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ fmt:
check-fmt:
isort -rc --check
black . --check --diff

coverage-test:
coverage run --source=$(APP) `which py.test` -s -v $(TEST)
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ bandit = "*"
black = "==19.10b0"
isort = "*"
pytest = "*"
pytest-cov="*"
pylint = "*"
coveralls = "*"
Comment on lines +11 to +13
Copy link
Collaborator

@Kilo59 Kilo59 Mar 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates to the Pipfile should always be accompanied by a new Pipfile.lock
Run pipenv lock to regenerate a new lockfile.
However, if you are on a windows machine it may not generate the correct dependencies for a deployment. If so let me know and I would be happy to generate it for you,


[packages]
fastapi = "*"
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Provides up-to-date data about Coronavirus outbreak. Includes numbers about conf
Support multiple data-sources.

![Travis build](https://api.travis-ci.com/ExpDev07/coronavirus-tracker-api.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/ExpDev07/coronavirus-tracker-api/badge.svg)](https://coveralls.io/github/ExpDev07/coronavirus-tracker-api)
[![License](https://img.shields.io/github/license/ExpDev07/coronavirus-tracker-api)](LICENSE.md)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
[![GitHub stars](https://img.shields.io/github/stars/ExpDev07/coronavirus-tracker-api)](https://github.com/ExpDev07/coronavirus-tracker-api/stargazers)
Expand All @@ -30,15 +31,15 @@ Support multiple data-sources.

Currently 2 different data-sources are available to retrieve the data:

* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).
* **jhu** - https://github.com/CSSEGISandData/COVID-19 - Worldwide Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).

* **csbs** - https://www.csbs.org/information-covid-19-coronavirus - U.S. County data that comes from the Conference of State Bank Supervisors.

__jhu__ data-source will be used as a default source if you don't specify a *source parameter* in your request.

## API Reference

All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
*[https://coronavirus-tracker-api.herokuapp.com/v2/locations](https://coronavirus-tracker-api.herokuapp.com/v2/locations)*

You can open the URL in your browser to further inspect the response. Or you can make this curl call in your terminal to see the prettified response:
Expand All @@ -54,7 +55,7 @@ Consume our API through [our super awesome and interactive SwaggerUI](https://co

The [OpenAPI](https://swagger.io/docs/specification/about/) json definition can be downloaded at https://coronavirus-tracker-api.herokuapp.com/openapi.json

## API Endpoints
## API Endpoints

### Sources Endpoint

Expand Down Expand Up @@ -363,7 +364,7 @@ These are the available API wrappers created by the community. They are not nece

### C#

* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper)
* [CovidSharp by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper)
* [Covid19Tracker.NET by @egbakou](https://github.com/egbakou/Covid19Tracker.NET)

### Python
Expand Down Expand Up @@ -407,7 +408,7 @@ You will need the following things properly installed on your computer.
3. Create virtual environment and install all dependencies `$ pipenv sync --dev`
4. Activate/enter the virtual environment `$ pipenv shell`

And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck.
And don't despair if don't get the python setup working on the first try. No one did. Guido got pretty close... once. But that's another story. Good luck.

## Running / Development

Expand Down