-
Notifications
You must be signed in to change notification settings - Fork 447
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
fix: Fixed tests running more than once and minor improvements #1095
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,34 +24,31 @@ jobs: | |
- uses: psf/black@stable | ||
|
||
build: | ||
name: Python==${{matrix.python}} | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: [3.7, 3.9] | ||
python: [3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.x | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Run tests | ||
run: | | ||
python -m unittest discover tests -v | ||
- name: Generate coverage report | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest --cov-config=.coveragerc | ||
pytest --cov=./ --cov-report=xml | ||
pip install -r requirements.txt | ||
|
||
- name: Run tests and generate report | ||
run: coverage run -m unittest discover tests -v | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
if: ${{ matrix.python == 3.7}} | ||
with: | ||
file: ./coverage.xml | ||
name: codecov-umbrella | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not related to this issue but upload coverage only if the maxtrix version is 3.7. Can you make this change too ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to upload coverage only when python version is 3.7? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because it's uploading the coverage for both the versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should maintain coverage for all versions. May be in future we have some compatibility shims then coverage will change for versions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see how the python version is going to affect the coverage : /. Plus When the bot comments there is no way to differentiate between which coverage corresponds to which version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was happening because all coverages have same name. Btw, I add a condition to upload coverage for Python 3.7 |
||
fail_ci_if_error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this is required please check on comment on vaishnavi's pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because sometimes code blocks failed for particular software/library version. We should test each version that we provide support for.