Skip to content

Comments

Enhance notebook testing and API key retrieval#56

Merged
splch merged 7 commits intomainfrom
pass-tests-2026
Jan 27, 2026
Merged

Enhance notebook testing and API key retrieval#56
splch merged 7 commits intomainfrom
pass-tests-2026

Conversation

@splch
Copy link
Contributor

@splch splch commented Jan 27, 2026

  • Updated test_notebooks.py to improve integration tests for Jupyter notebooks.

    • Added a timeout for notebook execution and improved error handling.
    • Skipped tests if the IONQ_API_KEY environment variable is not set.
    • Refactored notebook execution logic into a separate function for clarity.
  • Introduced helpers.py to centralize IonQ API key retrieval.

    • Implemented a function to get the API key from the environment or prompt the user interactively if not set.

splch and others added 7 commits January 26, 2026 18:33
- Updated `test_notebooks.py` to improve integration tests for Jupyter notebooks.
  - Added a timeout for notebook execution and improved error handling.
  - Skipped tests if the IONQ_API_KEY environment variable is not set.
  - Refactored notebook execution logic into a separate function for clarity.

- Introduced `helpers.py` to centralize IonQ API key retrieval.
  - Implemented a function to get the API key from the environment or prompt the user interactively if not set.
- Add detailed logging to GitHub Actions workflow with step-by-step output
- Add environment verification step to show Python version and packages
- Add test summary step that runs even if tests fail
- Enhance test_notebooks.py with detailed execution logging:
  - Show timestamp and duration for each notebook
  - Display progress with visual separators
  - Provide summary with pass/fail counts
  - Add better error reporting
- Add pytest and nbconvert to environment.yml (required for tests)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add discovery job to find all notebooks dynamically
- Use matrix strategy to run each notebook in parallel
- Set fail-fast: false to see all failures
- Add per-notebook execution logging with timestamps
- Upload HTML artifacts for each notebook
- Add summary job to report overall status
- Significantly reduces total CI/CD time

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace qasm3_drawer with pyqasm.draw per qBraid SDK changelog
- Add pyqasm to pip install dependencies
- Update import statement and function call

Fixes: ImportError: cannot import name 'qasm3_drawer' from 'qbraid.visualization'
Reference: qBraid/qBraid#943

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add pyproject.toml with all dependencies for modern Python packaging
- Create new GitHub Actions workflow using uv (test_notebooks_uv.yml)
- Update README with uv installation instructions (recommended method)
- Keep conda workflow as fallback option

Benefits of uv:
- 10-100x faster dependency resolution than pip/conda
- Significantly faster package installation
- Better caching and reproducible builds
- Compatible with entire PyPI ecosystem

Expected improvement: Reduce dependency installation from ~60s to ~10s

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Performance comparison (average per notebook):
- Conda: ~3 minutes
- uv: ~1 minute
- Improvement: 2.8x faster (66% reduction)

Specific improvements:
- api.ipynb: 3m5s → 47s (3.9x faster)
- qbraid.ipynb: 3m11s → 1m4s (3x faster)
- cuda-quantum: 3m9s → 1m24s (2.25x faster)
- pennylane.ipynb: 3m7s → 54s (3.5x faster)
- cirq.ipynb: 2m58s → 57s (3.1x faster)
- qiskit.ipynb: 2m53s → 55s (3.2x faster)

Benefits:
✓ Much faster dependency resolution and installation
✓ More efficient CI/CD minute usage
✓ Modern Python packaging with pyproject.toml
✓ Better developer experience

The conda environment.yml is kept for local development compatibility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@splch splch merged commit cc411a0 into main Jan 27, 2026
9 checks passed
@splch splch deleted the pass-tests-2026 branch January 27, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant