Skip to content

Commit

Permalink
ci,test: Add coverage reports to pytest runs. Upload them in GHA (#197)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleg Nikonychev <[email protected]>
  • Loading branch information
Unique-Divine and onikonychev authored Dec 29, 2022
1 parent 6e24d1c commit b3916a6
Show file tree
Hide file tree
Showing 4 changed files with 1,034 additions and 932 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
version: latest
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
Expand All @@ -89,5 +90,18 @@ jobs:
#----------------------------------------------
# run tests
#----------------------------------------------
- name: Install unbuffer command for run step
run: sudo apt-get install -y expect-dev
- name: Run Python SDK tests
run: poetry run pytest -s tests
run: unbuffer poetry run pytest -s tests --cov=nibiru | tee coverage.txt
# piping to tee lets us see stdout and write to a file simultaneously.
# unbuffer retains the colored text from pytest through the pipe to tee
# -s makes the output verbose to make logs more descriptive.
# --cov toggles on the coverage report at the specified path
#----------------------------------------------
# Upload test output and coverage report as a GitHub artifact
#----------------------------------------------
- uses: actions/upload-artifact@v3
with:
name: test-coverage
path: coverage.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
coverage.txt

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
Loading

0 comments on commit b3916a6

Please sign in to comment.