mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-05 23:45:30 +00:00
Merge pull request #61 from thousandeyes/feature-add-test-coverage
feature: add test coverage verification on PRs
This commit is contained in:
commit
1b3bf87ed5
22
.github/workflows/python.yaml
vendored
22
.github/workflows/python.yaml
vendored
@ -23,7 +23,27 @@ jobs:
|
||||
- name: Install and test modules
|
||||
run: |
|
||||
pip install pytest
|
||||
pip install coverage
|
||||
|
||||
# Initialize coverage data file
|
||||
coverage erase
|
||||
|
||||
for module in $(find . -maxdepth 1 -type d -name "thousandeyes-sdk-*" ! -name "thousandeyes-sdk-core" | cut -c 3-); do
|
||||
pip install -e $module
|
||||
pytest $module
|
||||
coverage run --source=$module -m pytest $module
|
||||
# Move the .coverage file to a unique name
|
||||
mv .coverage .coverage.$module
|
||||
done
|
||||
|
||||
# Combine all .coverage files
|
||||
coverage combine .coverage.*
|
||||
coverage report
|
||||
coverage xml
|
||||
|
||||
- name: Get Coverage
|
||||
uses: orgoro/coverage@v3.2
|
||||
with:
|
||||
coverageFile: ./coverage.xml
|
||||
thresholdAll: 0.4
|
||||
thresholdNew: 0.6
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user