Jupyter Notebooks: E2E Testing and Documentation in One
2024-12-18
While developing a quantum computing library, the author leveraged Jupyter Notebooks as both user guides and end-to-end tests. By reading environment variables (like SERVER_URL) within the notebooks, they achieved parameterization, allowing execution by users and automated CI/CD pipelines. Two methods for running notebooks were explored: nbclient for simplicity, and nbconvert/jq for more control but increased complexity. The author opted for nbclient's ease of use, effectively integrating documentation maintenance and code testing, ensuring the integrity of both with every merge request.
Development
E2E testing