Skip to content

Commit 9b24faa

Browse files
authored
Enable oqd pytests in PR CI (#1689)
**Context:** It was discovered that for oqd tests, CIs on PRs only run the cpp runtime device tests, not the pytests. **Description of the Change:** We enable oqd pytests in CI. **Benefits:** Better test coverage.
1 parent ae2fe11 commit 9b24faa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.github/workflows/check-catalyst.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ jobs:
478478
echo "RUNTIME_LIB_DIR=$(pwd)/runtime-build/lib" >> $GITHUB_ENV
479479
echo "MLIR_LIB_DIR=$(pwd)/llvm-build/lib" >> $GITHUB_ENV
480480
echo "OQC_LIB_DIR=$(pwd)/oqc-build" >> $GITHUB_ENV
481+
echo "OQD_LIB_DIR=$(pwd)/runtime-build/lib" >> $GITHUB_ENV
481482
echo "CATALYST_BIN_DIR=$(pwd)/quantum-build/bin" >> $GITHUB_ENV
482483
chmod +x $(pwd)/quantum-build/bin/catalyst # artifact upload does not preserve permissions
483484
@@ -488,7 +489,7 @@ jobs:
488489
- name: Run Python Pytest Tests
489490
run: |
490491
COVERAGE_REPORT="xml:coverage.xml -p no:warnings" \
491-
make coverage-frontend
492+
make coverage-frontend ENABLE_OQD=ON
492493
mv coverage.xml coverage-${{ github.job }}.xml
493494
494495
- name: Upload to Codecov

frontend/test/test_oqd/oqd/test_openapl_generation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_RX_gate(self):
4444
@qml.qnode(oqd_dev)
4545
def circuit(x):
4646
qml.RX(x, wires=0)
47-
return qml.counts()
47+
return qml.counts(wires=0)
4848

4949
circuit(np.pi / 2)
5050

@@ -70,7 +70,7 @@ def test_CNOT_gate(self):
7070
@qml.qnode(oqd_dev)
7171
def circuit():
7272
qml.CNOT(wires=[0, 1])
73-
return qml.counts()
73+
return qml.counts(wires=0)
7474

7575
circuit()
7676

0 commit comments

Comments
 (0)