Skip to content

Commit

Permalink
infra: add PL device testing using a stable PL version (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeCoull authored Sep 5, 2024
1 parent 043a332 commit b154dce
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/braket-latest-pl-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow template for testing plugins against PennyLane stable

name: PennyLane Device Test
on:
push:
branches:
- main
pull_request:
branches:
- main
- feature/**


jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Maximize build space
shell: bash
run: |
df -h
if [ "$RUNNER_OS" != "Windows" ]; then
sudo rm -rf /usr/share/dotnet &
sudo rm -rf /usr/local/lib/android &
sudo rm -rf /opt/ghc &
sudo rm -rf /usr/local/share/boost
fi
df -h
- name: Install dependencies
run: |
pip install tox
- name: Check build space
shell: bash
run: |
df -h
- name: Run PennyLane device integration tests
run: |
tox -e pennylane-device-tests
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@
"docutils>=0.19",
"flake8",
"flake8-rst-docstrings",
"flaky",
"isort",
"pre-commit",
"pylint>=3.1.0",
"pytest",
"pytest-benchmark",
"pytest-cov",
"pytest-mock",
"pytest-rerunfailures",
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ commands =
pytest test/integ_tests {posargs}
extras = test

[testenv:pennylane-device-tests]
# {posargs} contains additional arguments specified when invoking tox. e.g. tox -- -s -k test_foo.py
deps =
{[test-deps]deps}
commands =
pl-device-test --device=braket.local.qubit --tb=short --skip-ops --shots=20000 -k 'not no_0_shots'
pl-device-test --device=braket.local.qubit --tb=short --skip-ops -k 'not Sample and not no_0_shots'
extras = test

[testenv:linters]
basepython = python3
skip_install = true
Expand Down

0 comments on commit b154dce

Please sign in to comment.