This document details the automated testing workflow that executes on every pull request to validate code changes before they are merged. The testing workflow runs the full test suite across multiple Python versions in isolated environments, collects coverage data, and reports results back to the pull request.
For information about security scanning that also runs on pull requests, see Security Scanning. For the release-time testing and publication process, see Release Workflow Details.
The testing workflow follows a matrix testing pattern to ensure compatibility across all supported Python versions. While the explicit test workflow file is not provided in the repository files examined, the testing infrastructure can be inferred from the development setup and related workflows.
Sources: .github/workflows/publish.yml70-82 .github/workflows/docs.yml27-38
The testing workflow is triggered by multiple GitHub events to ensure comprehensive validation:
| Trigger Event | When It Fires | Purpose |
|---|---|---|
pull_request (opened) | New PR created | Validate new changes |
pull_request (synchronize) | New commits pushed to PR | Re-validate after updates |
push (master) | Direct push to master | Validate master branch state |
merge_group | PR added to merge queue | Final validation before merge |
The workflow uses concurrency groups to prevent redundant test runs:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
This pattern cancels in-progress runs when new commits are pushed to a PR, but preserves all runs on the master branch.
Sources: .github/workflows/snyk.yml3-22 .github/workflows/codeql.yml3-22
The workflow employs a matrix strategy to test against all supported Python versions simultaneously:
Each matrix job runs independently on a fresh GitHub Actions runner. The matrix configuration follows this structure:
The fail-fast: false setting ensures all Python versions are tested even if one fails, providing comprehensive compatibility information.
Sources: .github/workflows/rl-scanner.yml6-8 .github/workflows/codeql.yml29-32
Each test job follows a standardized environment setup process using Poetry for dependency management:
The setup steps are:
actions/setup-python@v6 to install the matrix-specified Python versionvirtualenvs.in-project to create .venv directory in the repositorypoetry install --with dev to install both production and development dependenciesThis process is consistent across all workflows in the repository.
Sources: .github/workflows/publish.yml70-82 .github/workflows/docs.yml27-38 .github/workflows/rl-scanner.yml39-54
The testing infrastructure uses bubblewrap sandboxing to isolate test execution. Bubblewrap is a lightweight sandboxing tool that creates a restricted environment for running tests, preventing:
The sandboxing mechanism ensures tests run in a reproducible, isolated environment that mirrors production constraints. This is particularly important for:
Sources: High-level system diagrams (Diagram 6: Development Workflow)
Tests are executed using pytest, the standard Python testing framework. The test command structure follows this pattern:
This command:
pyproject.tomltest_*.py or *_test.pyThe pytest configuration (located in pyproject.toml or pytest.ini) typically includes:
Sources: .github/workflows/publish.yml82 High-level system diagrams (Diagram 6: Development Workflow)
The workflow collects code coverage data and uploads it to Codecov for tracking test coverage over time:
The coverage workflow:
.coverage binary file and optionally a coverage.xml reportThis provides visibility into:
Sources: High-level system diagrams (Diagram 3: Deployment Pipeline, Diagram 6: Development Workflow)
The testing workflow integrates tightly with GitHub's pull request protection system:
Branch Protection Rules: The repository configures the test workflow as a required status check. Pull requests cannot be merged until:
Special Cases: The workflow includes logic to handle special scenarios:
This is implemented using conditional checks:
Sources: .github/workflows/snyk.yml31-32 .github/workflows/codeql.yml35-36
The testing workflow produces several outputs that are consumed by downstream processes:
| Output | Type | Purpose | Retention |
|---|---|---|---|
| Test Results | GitHub Check | PR status indicator | Permanent |
| Coverage Report | Artifact | Detailed coverage analysis | 90 days |
.coverage file | Artifact | Raw coverage data | 90 days |
| Pytest XML | Artifact | Machine-readable test results | 90 days |
| Logs | GitHub Actions Log | Debugging failed tests | 90 days |
These artifacts enable:
Sources: High-level system diagrams (Diagram 3: Deployment Pipeline)
The testing workflow is part of a comprehensive CI/CD pipeline:
Workflow Dependencies:
This architecture ensures quality gates at every stage of the development lifecycle.
Sources: .github/workflows/publish.yml14-30 .github/workflows/docs.yml3-16 .github/workflows/snyk.yml3-14
Refresh this wiki