mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-10 06:20:55 +08:00
added support for code coverage
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
|||||||
|
[run]
|
||||||
|
branch = True
|
||||||
|
source = cellxgene_gateway
|
||||||
|
|
||||||
|
[report]
|
||||||
|
exclude_lines =
|
||||||
|
if self.debug:
|
||||||
|
pragma: no cover
|
||||||
|
raise NotImplementedError
|
||||||
|
if __name__ == .__main__.:
|
||||||
|
ignore_errors = True
|
||||||
|
omit =
|
||||||
|
tests/*
|
||||||
@@ -45,5 +45,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
eval "$(conda shell.bash hook)"
|
eval "$(conda shell.bash hook)"
|
||||||
conda activate cellxgene-gateway
|
conda activate cellxgene-gateway
|
||||||
python -m unittest discover tests
|
coverage run -m unittest discover tests
|
||||||
bash <(curl -s https://codecov.io/bash)
|
|
||||||
|
- name: Check coverage
|
||||||
|
run: |
|
||||||
|
eval "$(conda shell.bash hook)"
|
||||||
|
conda activate cellxgene-gateway
|
||||||
|
coverage report --fail-under 41
|
||||||
|
coverage xml -i
|
||||||
|
|
||||||
|
- name: "Upload coverage to Codecov"
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
fail_ci_if_error: true
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ htmlcov/
|
|||||||
.nox/
|
.nox/
|
||||||
.coverage
|
.coverage
|
||||||
.coverage.*
|
.coverage.*
|
||||||
|
htmlcov
|
||||||
.cache
|
.cache
|
||||||
nosetests.xml
|
nosetests.xml
|
||||||
coverage.xml
|
coverage.xml
|
||||||
|
|||||||
@@ -140,6 +140,12 @@ pre-commit install
|
|||||||
python -m unittest discover tests
|
python -m unittest discover tests
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Code Coverage
|
||||||
|
```bash
|
||||||
|
coverage run -m unittest discover tests
|
||||||
|
coverage html
|
||||||
|
```
|
||||||
|
|
||||||
## Running Linters
|
## Running Linters
|
||||||
|
|
||||||
pip install isort flake8 black
|
pip install isort flake8 black
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ dependencies:
|
|||||||
- flask
|
- flask
|
||||||
- psutil
|
- psutil
|
||||||
- black
|
- black
|
||||||
|
- coverage
|
||||||
- pip
|
- pip
|
||||||
- pip:
|
- pip:
|
||||||
- flask-api
|
- flask-api
|
||||||
|
|||||||
Reference in New Issue
Block a user