mirror of
https://github.com/langchain-ai/langsmith-self-hosted-workshops.git
synced 2026-07-01 20:44:14 -04:00
ea6131b394
Add comprehensive testing infrastructure to validate notebook syntax and
execution using pytest and GitHub Actions. This enables automated
validation of notebooks on every PR to ensure they remain structurally
valid and executable.
Components added:
- tests/ directory
* conftest.py: Pytest configuration with test environment setup
* test_notebook_execution.py: Notebook syntax and execution tests
* requirements.txt: Test dependencies (pytest, jupyter, nbconvert)
* README.md: Test documentation and usage guide
* .gitignore: Test artifacts exclusion
- .github/workflows/ directory
* test-notebooks.yml: Main GitHub Actions workflow
- Syntax validation for all notebooks
- Module 1 preflight testing
- Module 2 syntax validation
- Python code linting
* README.md: Workflow documentation
Test strategy:
- Syntax tests: Always run (validate JSON structure, code cells)
- Execution tests: Optional (requires infrastructure, skipped in CI)
- Modular design: Separate test classes per module
- Parametrized tests: Easy to add new notebooks
GitHub Actions workflow:
- Triggers on PRs, pushes to main, and manual dispatch
- Multiple parallel jobs for faster feedback
- Environment variables configured for test execution
- Artifact uploads for debugging
Fixes:
- Renamed base class helper method to prevent pytest discovery
- Fixed fixture dependency issues in test structure
Usage:
- Local: `CI_SKIP_EXECUTION=true pytest tests/ -v`
- CI: Automatically runs on PRs to validate notebook syntax
- Extensible: Easy to add tests for new modules
This ensures notebooks remain valid and executable as the codebase evolves.
3 lines
55 B
Python
3 lines
55 B
Python
# Tests for LangSmith Self-Hosted Workshops notebooks
|
|
|