Skip to content
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
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ jobs:
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run unit tests
run: make unit-test-coverage
- name: Upload unit test coverage report
uses: actions/upload-artifact@v2
- name: Report coverage to coveralls.io
uses: coverallsapp/github-action@1.1.3
with:
name: Unit test coverage report - python${{ matrix.python-version }}-${{ matrix.os }}
path: htmlcov
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: unit-tests_python${{ matrix.python-version }}-${{ matrix.os }}
parallel: true
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that our coverage differs based on environment, test type and potentially other factors I like the ability to report coverage metrics for all jobs in a single run.

Shows up in Coveralls like below
image

path-to-lcov: coverage.lcov
integration-tests:
if: ${{ github.event_name == 'push' }}
# only kick-off resource intensive integration tests if unit tests and all basic checks succeeded
Expand Down Expand Up @@ -133,8 +135,21 @@ jobs:
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run integration tests
run: make integration-test-coverage
- name: Upload integration test coverage report
uses: actions/upload-artifact@v2
- name: Report coverage to coveralls.io
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: integration-tests_${{ matrix.environment }}
parallel: true
path-to-lcov: coverage.lcov
tests-finished:
Comment thread
daka1510 marked this conversation as resolved.
if: ${{ always() }}
name: Submit code coverage metrics
needs: [ unit-tests, integration-tests ]
runs-on: ubuntu-latest
steps:
- name: Notify coveralls.io that all parallel tests have finished
uses: coverallsapp/github-action@1.1.3
with:
name: Integration test coverage report - ${{ matrix.environment }}
path: htmlcov
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ e2e-test:

unit-test-coverage:
coverage run -m unittest discover --verbose --top-level-directory . --start-directory test/unit
coverage html
coverage lcov

integration-test-coverage:
coverage run -m unittest discover --verbose --top-level-directory . --start-directory test/integration
coverage html
coverage lcov

e2e-test-coverage:
coverage run -m unittest discover --verbose --top-level-directory . --start-directory test/e2e
coverage html
coverage lcov

black:
black qiskit_ibm_runtime setup.py test docs/tutorials program_source
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ qiskit-aer
websockets>=8
scikit-quant;platform_system != 'Windows'
black==21.11b1
coverage>=6.2
coverage>=6.3
Comment thread
rathishcholarajan marked this conversation as resolved.
pylatexenc
mthree
sklearn