Skip to content

Commit

Permalink
Include test suite in coverage (#123)
Browse files Browse the repository at this point in the history
* Update test workflow to include test suite in coverage

* Update makefile

* Add to changelog
  • Loading branch information
trbromley committed Aug 9, 2021
1 parent 2b26841 commit e309d44
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

### Improvements

* The PennyLane device test suite is now included in coverage reports.
[(123)](https://github.com/PennyLaneAI/pennylane-lightning/pull/123)

* Static versions of jQuery and Bootstrap are no longer included in the CSS theme.
[(118)](https://github.com/PennyLaneAI/pennylane-lightning/pull/118)

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- master
pull_request:

env:
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:../coverage.xml --no-flaky-report -p no:warnings --tb=native"

jobs:
cpptests:
name: C++ tests
Expand Down Expand Up @@ -80,14 +83,11 @@ jobs:
- name: Run PennyLane-Lightning unit tests
run: |
cd main/
pytest tests/ --cov=pennylane_lightning --cov-report term-missing --cov-report=xml:../coverage.xml
pytest tests/ $COVERAGE_FLAGS
pl-device-test --device lightning.qubit --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device lightning.qubit --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.12
with:
file: coverage.xml

- name: Run PennyLane shared test suite
run: |
pl-device-test --device lightning.qubit --skip-ops --shots=20000
pl-device-test --device lightning.qubit --shots=None --skip-ops
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,22 @@ clean-docs:
rm -rf doc/code/api
make -C doc clean

test:
test-builtin:
$(PYTHON) -I $(TESTRUNNER)

test-suite:
pl-device-test --device lightning.qubit --skip-ops --shots=20000
pl-device-test --device lightning.qubit --shots=None --skip-ops

test-python: test-builtin test-suite
test-builtin
test-suite

coverage:
@echo "Generating coverage report..."
$(PYTHON) $(TESTRUNNER) $(COVERAGE)
pl-device-test --device lightning.qubit --skip-ops --shots=20000 $(COVERAGE) --cov-append
pl-device-test --device lightning.qubit --shots=None --skip-ops $(COVERAGE) --cov-append

test-cpp:
rm -rf ./BuildTests
Expand Down

0 comments on commit e309d44

Please sign in to comment.