mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 07:55:31 +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
|
- name: Install and test modules
|
||||||
run: |
|
run: |
|
||||||
pip install pytest
|
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
|
for module in $(find . -maxdepth 1 -type d -name "thousandeyes-sdk-*" ! -name "thousandeyes-sdk-core" | cut -c 3-); do
|
||||||
pip install -e $module
|
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
|
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