Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add coverage for client #310

Merged
merged 6 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 16 additions & 8 deletions .github/workflows/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,20 @@ jobs:
working-directory: ./client
run: make ut

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0
- name: Publish coverage to Coveralls
uses: AndreMiras/coveralls-python-action@v20201129
with:
name: codecov
fail_ci_if_error: false
directory: ./client/coverage/reports/
files: ./coverage.xml
flags: unittests
verbose: true
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
debug: true
base-path: ./client
flag-name: unittest

coveralls_finish:
needs: unittest
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,21 @@ yarn-debug.log*
yarn-error.log*
/docker/jar/
/server/controller/src/main/resources/static/

# Test Coverage
.coverage
.coverage.*
coverage.xml
*.cover
.pytest_cache/
*,cover
htmlcov/

# Python
__pycache__
.Python
pip-delete-this-directory.txt
.mypy*

# Other
.cache
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<img src="https://github.com/star-whale/starwhale/actions/workflows/console.yml/badge.svg">
</a>

<a href='https://coveralls.io/github/star-whale/starwhale?branch=main'>
<img src='https://coveralls.io/repos/github/star-whale/starwhale/badge.svg?branch=main' alt='Python Client/SDK Coverage Status' />
</a>

</p>

## What is Starwhale
Expand Down
15 changes: 15 additions & 0 deletions client/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[report]
omit =
*/site-packages/*
*/dist/*
*/build/*
show_missing = true
exclude_lines =
pragma: no cover
def __repr__
def __str__
raise NotImplementedError
if __name__ == .__main__.:

[run]
relative_files = True
1 change: 1 addition & 0 deletions client/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# W605: invalid escape sequence '\#'
ignore= H101,W503,E203,E731,W605
max-line-length = 120
max-complexity = 18
exclude =
.eggs
.egg-info
Expand Down
2 changes: 1 addition & 1 deletion client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ci-mypy:

ut:
echo "ut"
pytest tests -vvrfEsx
pytest tests -vvrfEsx --cov-config=.coveragerc --cov=starwhale --cov-report=xml:coverage.xml --cov-report=term-missing

install-req:
python3 -m pip install .
Expand Down
3 changes: 2 additions & 1 deletion client/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ types-boto3
pytest >= 6.0
testfixtures >= 6.10.3
pytest-env >= 0.6.0
pytest-xdist >= 2.0
pytest-xdist >= 2.0
pytest-cov>=3.0.0