-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test notebooks with
test-eagle
(#2463)
There are three changes in this PR 1. (2d2fb9c) **Make notebooks runnable with nb-tester** This commit modifies some of the notebooks to make them executable from start to finish. Most common change is defining `instance` and `backend_name` in a hidden cell and giving example values through a comment, rather than having `backend_name = '<your-backend>'`. 2. (945b8d7) **Add extended strategy and reclassify notebooks** Adds a new "extended" test that runs the notebooks on IBM Quantum's `test-eagle` device. This device accepts jobs and returns random bit strings in a very short time period, which is great for testing notebooks that submit jobs too large for a local simulator. This also allows us to test functions notebooks, which take a backend name (string) of an IBM Quantum device, rather than the backend object itself. 3. (9f3df9e) **Add extended notebook tests action** I originally hoped we could test notebooks with test-eagle in CI, but the jobs can be flaky and take just a little too long to complete. Running these jobs on every commit is too expensive and could block writers. Instead, I've added a new "extended" test that we can trigger manually on branches when we need it. Examples could be dependabot PRs, or PRs to functions notebooks; when the PR is ready, we'll trigger the workflow on the PR branch to check the notebooks run correctly. To trigger the workflow, go to Actions > Test notebook (extended) > Run workflow, then select the PR branch and click "Run workflow". *** Fixes #2240, fixes #2239, and fixes #2198.
- Loading branch information
1 parent
38f3e28
commit 6ba4574
Showing
10 changed files
with
273 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This code is a Qiskit project. | ||
# | ||
# (C) Copyright IBM 2024. | ||
# | ||
# This code is licensed under the Apache License, Version 2.0. You may | ||
# obtain a copy of this license in the LICENSE file in the root directory | ||
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# Any modifications or derivative works of this code must retain this | ||
# copyright notice, and modified files need to carry a notice indicating | ||
# that they have been altered from the originals. | ||
|
||
name: Test notebooks that submit jobs | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
execute: | ||
name: Execute notebooks with test-eagle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get relevant changed files | ||
id: all-changed | ||
uses: tj-actions/changed-files@af2816c65436325c50621100d67f6e853cd1b0f1 | ||
with: | ||
files: "{docs/**/*.ipynb,scripts/nb-tester/**/*}" | ||
separator: "\n" | ||
write_output_files: true | ||
|
||
- name: Setup environment | ||
uses: ./.github/actions/set-up-notebook-testing | ||
with: | ||
ibm-quantum-token: ${{ secrets.IBM_QUANTUM_TEST_TOKEN }} | ||
instance: "client-enablement/documentation/qiskit-documenta" | ||
|
||
- name: Execute notebooks | ||
run: python scripts/ci/extended-execute-notebooks.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.