pytest-selective 1.1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytest_selective-1.1.2/.github/workflows/dry-lint-audit.yml +23 -0
- pytest_selective-1.1.2/.release-please-manifest.json +3 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/CHANGELOG.md +7 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/PKG-INFO +4 -4
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/README.md +3 -3
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/actions/plan-lanes/action.yml +4 -2
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/actions.md +4 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/ci.md +3 -4
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/configuration.md +9 -4
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/pyproject.toml +1 -1
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/measure_ci_runs.py +4 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/skills/pytest-selective/SKILL.md +137 -81
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_graph.py +6 -1
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_models.py +21 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_public_actions.py +8 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_impact_graph.py +31 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/uv.lock +1 -1
- pytest_selective-1.1.1/.github/workflows/dry-lint-audit.yml +0 -91
- pytest_selective-1.1.1/.release-please-manifest.json +0 -3
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.dry-lint/baseline.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.dry-lint/progress.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.dry-lint.toml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.gitattributes +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/dependabot.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/test-lanes.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/validation-inputs.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/ci.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/docs.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/dry-lint-judge.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/dry-lint.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/observe-ci.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/pr-title.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/public-actions.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/release-please.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/release.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.github/workflows/windows-performance.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.gitignore +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.pre-commit-config.yaml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/.readthedocs.yaml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/AGENTS.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/CLAUDE.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/CONTRIBUTING.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/LICENSE +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/PROVENANCE.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/RELEASING.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/action.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/actions/README.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/actions/pytest-expansion/action.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/actions/test-impact/action.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/actions/validation-gate/action.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/agentsync.toml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/README.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/conftest.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/quint-connect.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/quint.ini +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/runtime_deps.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/selection.qnt +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/selection_driver.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/contracts/selection/test_selection_contract.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/README.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/agents.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/banner.png +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/banner.svg +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/brand.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/icon.png +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/logo.svg +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/raster-sources.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/social-preview.png +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/assets/social-preview.svg +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-due-ci.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-due-docs-ci.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-due-docs-widget.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-due-widget.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-input-replays.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-obligation-docs.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-obligation.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-routing.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22-selective-docs.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-22.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/obligation-baseline.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-after-3.11.xml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-after-3.14.xml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-after.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-control-3.11.xml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-control-3.14.xml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-control.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor/selective-earlier.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/2026-10-23-windows-saleor.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/benchmarks/windows-runtime.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/ci-toolkit.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/comparison-pytest-impacted.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/evidence.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/local-development.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/pytest-hygiene.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/selection-health.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/tutorial.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/tutorials/adoption-checklist.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/tutorials/sidecar-dependencies.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/tutorials/skip-unrelated-ci.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/actions-directory-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/codex-selector-correctness-performance-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/codex-windows-git-performance-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/graph-based-inputs-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/impacted-improvements-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/move-action-implementations-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/public-action-onboarding-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/ratchet-duplicates-zero-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/docs/work-in-progress/tickets/rerun-selection-test-plan.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/assets/routing-comparison.svg +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/check_site.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/ecosystem.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/hooks.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/index.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/llms.txt +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/overrides/main.html +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/publishing.md +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/requirements.in +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/documentation/requirements.txt +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/mkdocs.yml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/release-please-config.json +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/benchmark_graph.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/benchmark_parsing.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/benchmark_rust.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/check_docs.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/check_metadata.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/ci_file_config.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/compare_impacted.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/public_actions.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/render_brand.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/run_ci_tests.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/smoke_distribution.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/scripts/tutorial.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/skills/pytest-selective/agents/openai.yaml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/__init__.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/__main__.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/ast_imports.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/checkpoint.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/ci.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/gate.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/git_operations.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/hygiene.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_audit.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_audit_plugin.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_cli.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_declarations.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_explanation.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_first_party.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_name_scope.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/impact_selection.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/input_policy.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/local.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/parse_batch.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/plugin.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/py.typed +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/pytest_expansion.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/pytest_plugins.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/pytest_sharding.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/test_inventory.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/typecheck_scope.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/src/pytest_selective/working_tree.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/__init__.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_checkpoint_policy.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_ci_admission.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_ci_measurements.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_ci_test_execution.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_distribution_metadata.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_hygiene.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_pytest_expansion.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_release_workflow.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_repository_ci.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_repository_hygiene.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_repository_hygiene.py.gv-dependency.yaml +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/test_tutorial.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/__init__.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/git_repo.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_ast_imports.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_ci.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_gate.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_git_repo.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_global_inputs.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_impact_audit.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_impact_explanation.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_impact_first_party.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_impact_name_scope.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_parse_batch.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_portability.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_pytest_plugin.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_pytest_plugins.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_pytest_sharding.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_typecheck_scope.py +0 -0
- {pytest_selective-1.1.1 → pytest_selective-1.1.2}/tests/testing/test_working_tree.py +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: dry-lint audit
|
|
2
|
+
# Weekly, or dispatched after merging a cleanup: dry-lint's own audit workflow sweeps the repository against the
|
|
3
|
+
# accepted backlog and opens or updates one dry-lint/ratchet pull request recording what was cleaned. Its steps ship
|
|
4
|
+
# with dry-lint releases; this file only says when it runs and with which credentials.
|
|
5
|
+
on:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: '23 6 * * 1'
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
# dry-lint.yml calls this file on a manual dispatch, to exercise the audit with the rest of the checks.
|
|
10
|
+
workflow_call:
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
jobs:
|
|
14
|
+
audit:
|
|
15
|
+
uses: gigaverse-app/dry-lint/.github/workflows/audit.yml@v1
|
|
16
|
+
with:
|
|
17
|
+
python-version: '3.13'
|
|
18
|
+
budget-usd: '5'
|
|
19
|
+
plugins: anthropic==2.4.0
|
|
20
|
+
secrets:
|
|
21
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
22
|
+
# The organization credential makes the ratchet pull request run ordinary CI.
|
|
23
|
+
DRY_LINT_RATCHET_TOKEN: ${{ secrets.GV_CI_CROSS_REPO_TOKEN }}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.2](https://github.com/gigaverse-app/pytest-selective/compare/v1.1.1...v1.1.2) (2026-11-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug fixes
|
|
7
|
+
|
|
8
|
+
* agent setup round 2, from a second adoption trial ([#114](https://github.com/gigaverse-app/pytest-selective/issues/114)) ([45d4afe](https://github.com/gigaverse-app/pytest-selective/commit/45d4afe76cde9f6093519d97000244c6c06b157d))
|
|
9
|
+
|
|
3
10
|
## [1.1.1](https://github.com/gigaverse-app/pytest-selective/compare/v1.1.0...v1.1.1) (2026-11-09)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pytest-selective
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Explainable Python test impact analysis: select affected pytest files from Git changes
|
|
5
5
|
Project-URL: Homepage, https://github.com/gigaverse-app/pytest-selective
|
|
6
6
|
Project-URL: Documentation, https://pytest-selective.readthedocs.io/en/latest/
|
|
@@ -60,9 +60,9 @@ the affected test files, and explains the result. Use it directly as a pytest
|
|
|
60
60
|
plugin, or plan before collection and service startup with the CLI and CI actions.
|
|
61
61
|
|
|
62
62
|
Built from the selector used in Gigaverse's backend, AI, and shared Python
|
|
63
|
-
infrastructure.
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
infrastructure. Use the actions at the moving `@v1` tag, which follows the newest
|
|
64
|
+
release, and the package at `pytest-selective>=X.Y.Z,<2`. Where your tooling rejects
|
|
65
|
+
tags, pin both to one release instead: `@<sha> # vX.Y.Z` and `pytest-selective==X.Y.Z`.
|
|
66
66
|
[Provenance and extraction scope](https://github.com/gigaverse-app/pytest-selective/blob/main/PROVENANCE.md).
|
|
67
67
|
|
|
68
68
|
[Quick tutorial](https://github.com/gigaverse-app/pytest-selective/blob/main/docs/tutorial.md) ·
|
|
@@ -29,9 +29,9 @@ the affected test files, and explains the result. Use it directly as a pytest
|
|
|
29
29
|
plugin, or plan before collection and service startup with the CLI and CI actions.
|
|
30
30
|
|
|
31
31
|
Built from the selector used in Gigaverse's backend, AI, and shared Python
|
|
32
|
-
infrastructure.
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
infrastructure. Use the actions at the moving `@v1` tag, which follows the newest
|
|
33
|
+
release, and the package at `pytest-selective>=X.Y.Z,<2`. Where your tooling rejects
|
|
34
|
+
tags, pin both to one release instead: `@<sha> # vX.Y.Z` and `pytest-selective==X.Y.Z`.
|
|
35
35
|
[Provenance and extraction scope](https://github.com/gigaverse-app/pytest-selective/blob/main/PROVENANCE.md).
|
|
36
36
|
|
|
37
37
|
[Quick tutorial](https://github.com/gigaverse-app/pytest-selective/blob/main/docs/tutorial.md) ·
|
|
@@ -12,8 +12,10 @@ inputs:
|
|
|
12
12
|
default: auto
|
|
13
13
|
artifact-name:
|
|
14
14
|
description: >
|
|
15
|
-
Upload the lane plan under this name, where
|
|
16
|
-
the sticky's lane section.
|
|
15
|
+
Upload the lane plan (test-lanes.json) as an artifact under this name, where
|
|
16
|
+
CI-esta's report renders it as the sticky's lane section. Give each planner job
|
|
17
|
+
in one workflow run its own name. Empty skips the upload; planning and the
|
|
18
|
+
outputs are unchanged.
|
|
17
19
|
default: test-lane-selection
|
|
18
20
|
outputs:
|
|
19
21
|
lanes:
|
|
@@ -28,6 +28,10 @@ supported on GitHub.com with runner 2.336.0 or newer. Individual `actions/NAME`
|
|
|
28
28
|
entry points call the implementations directly and do not require that syntax.
|
|
29
29
|
[GitHub reference documentation](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax).
|
|
30
30
|
|
|
31
|
+
`plan-lanes` uploads its plan as the `test-lane-selection` artifact by default. Set
|
|
32
|
+
`artifact-name` to rename it, which a second planner job in the same workflow run needs, or to
|
|
33
|
+
`''` to skip the upload.
|
|
34
|
+
|
|
31
35
|
## Action reference
|
|
32
36
|
|
|
33
37
|
Each link below is the public action's complete input/output contract.
|
|
@@ -253,11 +253,10 @@ job per workflow the required check and run
|
|
|
253
253
|
gated job to its lanes. It fails unless each prerequisite succeeded or was skipped while
|
|
254
254
|
the planner succeeded and every mapped lane is `false`; a failed planner fails it.
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
skipping it skips publishing.
|
|
258
|
-
(`github.event_name != 'pull_request' || ...`), or plan inside the job with
|
|
256
|
+
Never gate a job that a publish or deploy job `needs:`, directly or transitively:
|
|
257
|
+
skipping it skips publishing. Leave it ungated, or plan inside the job with
|
|
259
258
|
`continue-on-error: true` and admit only its expensive steps, as the `distributions`
|
|
260
|
-
job in this repository's CI does. A branch's first push has no previous commit, so
|
|
259
|
+
job in this repository's CI does. Gate every other job that installs, builds or tests. A branch's first push has no previous commit, so
|
|
261
260
|
`on: push` for every branch runs every lane once per new branch; prefer pull-request
|
|
262
261
|
triggers plus pushes to the default branch.
|
|
263
262
|
The default event policy handles manual/release checkpoints, schedules and
|
|
@@ -24,9 +24,10 @@ select. The default filenames are `test_*.py`, `*_test.py`, `*_tests.py`, and
|
|
|
24
24
|
|
|
25
25
|
## Review and record collection policy
|
|
26
26
|
|
|
27
|
-
If your repository has `pyproject.toml`, `pytest.ini`, `tox.ini
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
If your repository has `pyproject.toml`, `pytest.ini`, a `tox.ini` with a `[pytest]`
|
|
28
|
+
section, or a `setup.cfg` with a `[tool:pytest]` section, record its committed
|
|
29
|
+
pytest-policy fingerprints. A `pyproject.toml` or `pytest.ini` with no pytest settings
|
|
30
|
+
still has a fingerprint, because pytest can still choose it. This review prevents a new
|
|
30
31
|
collection rule from silently invalidating the inventory.
|
|
31
32
|
|
|
32
33
|
```bash
|
|
@@ -135,7 +136,11 @@ Unsupported checker patterns retain the full-check fallback.
|
|
|
135
136
|
|
|
136
137
|
The policy fingerprints cover conventional pytest configuration names, including
|
|
137
138
|
`pytest.toml`, `.pytest.toml`, `.pytest.ini` and nested candidates. Empty candidates
|
|
138
|
-
are included because their presence can change pytest's root and precedence.
|
|
139
|
+
are included because their presence can change pytest's root and precedence. A
|
|
140
|
+
`tox.ini` without `[pytest]` and a `setup.cfg` without `[tool:pytest]` are not: pytest
|
|
141
|
+
skips them. Adding that section later changes the fingerprints and needs a review.
|
|
142
|
+
Releases up to 1.1.1 recorded such a file as the hash of an empty policy; that entry
|
|
143
|
+
is still accepted and needs no refresh.
|
|
139
144
|
Changes require reviewing and refreshing `pytest_policy`; until then planning
|
|
140
145
|
fails safely and the CI action runs the complete configured roots.
|
|
141
146
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pytest-selective"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.2"
|
|
8
8
|
description = "Explainable Python test impact analysis: select affected pytest files from Git changes"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -5,6 +5,10 @@ head. A side may hold several workflow runs (for example CI and Docs triggered b
|
|
|
5
5
|
push): runner-seconds add up and elapsed runs from the first run's creation to the last job's
|
|
6
6
|
completion. `--expected-failure JOB` accepts that job's deliberate failure (a probe) as executed
|
|
7
7
|
work instead of rejecting the run; any other failed, cancelled or unfinished job still does.
|
|
8
|
+
|
|
9
|
+
The sides may come from different events. A `pull_request` run records the branch head as its
|
|
10
|
+
`head_sha` (although it checks out the merge commit), so a `workflow_dispatch` or `push` run on
|
|
11
|
+
that branch is the same head: the usual full control beside a selected pull-request run.
|
|
8
12
|
"""
|
|
9
13
|
|
|
10
14
|
import argparse
|
|
@@ -24,7 +24,11 @@ matrix, services and coverage checks unchanged.
|
|
|
24
24
|
release publishes. Selection only decides whether a job starts.
|
|
25
25
|
- Stop and tell the human, with the exact step, when something needs a repository setting: required checks, rulesets,
|
|
26
26
|
labels, secrets. Do not change them yourself.
|
|
27
|
-
-
|
|
27
|
+
- Name the repository on every `gh` command; in a clone of a fork, `gh` otherwise picks the upstream repository.
|
|
28
|
+
`gh pr`, `gh run`, `gh workflow`, `gh label`, `gh secret` and `gh release` take `--repo "$REPO"`; `gh repo view`
|
|
29
|
+
takes it as an argument (`gh repo view "$REPO"`); `gh api` takes it in the path (`repos/$REPO/...`).
|
|
30
|
+
- Keep scratch files in `.test-impact/` (ignored, step 3), not `/tmp`: native Windows Python cannot open Git Bash's
|
|
31
|
+
`/tmp`.
|
|
28
32
|
- If a command fails, report the exact command and its error. Do not make a failure pass by widening or emptying
|
|
29
33
|
inputs, ignoring a test directory, or removing a job from the gate.
|
|
30
34
|
|
|
@@ -34,7 +38,8 @@ Run these and note the answers. Every later step uses them.
|
|
|
34
38
|
|
|
35
39
|
```bash
|
|
36
40
|
REPO=OWNER/NAME # the repository you will open the pull request in: check `git remote -v`; in a fork, the fork
|
|
37
|
-
gh repo view
|
|
41
|
+
gh repo view "$REPO" --json defaultBranchRef -q .defaultBranchRef.name # DEFAULT below
|
|
42
|
+
gh api "repos/$REPO" --jq '.parent.full_name // "not a fork"' # UPSTREAM below
|
|
38
43
|
ls AGENTS.md CLAUDE.md CONTRIBUTING.md .github/pull_request_template.md .github/PULL_REQUEST_TEMPLATE* \
|
|
39
44
|
.pre-commit-config.yaml zizmor.yml .github/zizmor.yml 2>/dev/null
|
|
40
45
|
ls pyproject.toml setup.cfg setup.py tox.ini noxfile.py pytest.ini uv.lock poetry.lock pdm.lock Pipfile.lock \
|
|
@@ -46,6 +51,9 @@ gh run list --repo "$REPO" --branch DEFAULT --limit 10 --json databaseId,workflo
|
|
|
46
51
|
gh api "repos/$REPO/branches/DEFAULT/protection/required_status_checks" --jq .contexts # 403/404: ask the human
|
|
47
52
|
```
|
|
48
53
|
|
|
54
|
+
A fresh fork has no runs yet. Read the typical jobs and durations from UPSTREAM instead, read-only: the same
|
|
55
|
+
`gh run list` and `gh run view` commands with `--repo UPSTREAM`. Never push, label or dispatch there.
|
|
56
|
+
|
|
49
57
|
Record:
|
|
50
58
|
|
|
51
59
|
- **Conventions**: commit and PR title style, changelog rules, AI policy, pre-commit hooks.
|
|
@@ -64,24 +72,25 @@ Record:
|
|
|
64
72
|
If CI already finishes in a couple of minutes, or nearly every change touches source code, say so in your report:
|
|
65
73
|
selection saves little there. Continue only if the human's request still stands.
|
|
66
74
|
|
|
67
|
-
###
|
|
75
|
+
### Which version
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
Reference the actions by the moving major tag, `gigaverse-app/pytest-selective/actions/NAME@v1`: planner fixes reach
|
|
78
|
+
the repository without a pull request per release. The measurement script (step 8) comes from `v1` too. Resolve the
|
|
79
|
+
latest release once for the package:
|
|
70
80
|
|
|
71
81
|
```bash
|
|
72
82
|
TAG=$(gh release view --repo gigaverse-app/pytest-selective --json tagName -q .tagName) # for example v1.1.0
|
|
73
83
|
VERSION=${TAG#v}
|
|
74
|
-
SHA=$(gh api "repos/gigaverse-app/pytest-selective/commits/$TAG" --jq .sha)
|
|
75
84
|
```
|
|
76
85
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`gigaverse-app/pytest-selective/actions/NAME@<ref>`, where `<ref>` follows the repository's pinning policy:
|
|
80
|
-
`@$SHA # $TAG` if it pins commit SHAs, otherwise `@$TAG`. Update them together. The moving `@v1` tag also works,
|
|
81
|
-
but it runs a newer planner than the version your routing tests install.
|
|
86
|
+
Local commands use `pytest-selective==$VERSION`; the routing-test job (step 6) installs `pytest-selective>=$VERSION,<2`,
|
|
87
|
+
so it follows the same major version as `@v1`.
|
|
82
88
|
|
|
83
|
-
|
|
84
|
-
|
|
89
|
+
Only when the repository's tooling rejects tags (zizmor's `unpinned-uses`, a `pinact` hook, or an all-SHA policy its
|
|
90
|
+
CI enforces) pin the release instead: `@$SHA # $TAG` on every action, with
|
|
91
|
+
`SHA=$(gh api "repos/gigaverse-app/pytest-selective/commits/$TAG" --jq .sha)` (this resolves an annotated tag to its
|
|
92
|
+
commit; `git/ref/tags/TAG` would return the tag object), and `pytest-selective==$VERSION` in the routing job. Update
|
|
93
|
+
them together.
|
|
85
94
|
|
|
86
95
|
## 2. Choose lanes
|
|
87
96
|
|
|
@@ -96,7 +105,8 @@ Start with as few lanes as the jobs need:
|
|
|
96
105
|
| Your routing tests (step 6) | `routing`: roots = their directory |
|
|
97
106
|
| Integration tests with services, or another suite run separately | its own lane with its own roots |
|
|
98
107
|
|
|
99
|
-
Keep these unconditional: the planner, lint, type checking, documentation builds, link checks
|
|
108
|
+
Keep these unconditional: the planner, lint, type checking, documentation builds, link checks, the gate, and every
|
|
109
|
+
job a publish or deploy job needs (step 4.4). Every other job that installs, builds or tests the project is gated.
|
|
100
110
|
|
|
101
111
|
Optionally, developers can also run only affected tests locally with `pytest --selective` after adding
|
|
102
112
|
`pytest-selective` to the test dependencies (`uv add --dev`, `poetry add --group dev`, a `tests` extra, a tox `deps`
|
|
@@ -137,9 +147,13 @@ Adapt every path; this is a shape, not an inventory. The rules:
|
|
|
137
147
|
them. Omitted, the built-in list applies: `pyproject.toml`, `setup.cfg`, `setup.py`, `tox.ini`, `pytest.ini`,
|
|
138
148
|
`pytest.toml`, `uv.lock`, `poetry.lock`, `pdm.lock`, `pixi.lock`, `Pipfile`, `Pipfile.lock`, `*requirements*.txt`,
|
|
139
149
|
`*requirements*.in`, `requirements*.lock`, `pylock*.toml`, `requirements/**` and `*constraints*.txt`, anywhere in the
|
|
140
|
-
tree.
|
|
141
|
-
|
|
142
|
-
|
|
150
|
+
tree. Root-level files match too: `requirements-mypy.txt`, `requirements-lint.txt` or `docs-requirements.txt` each
|
|
151
|
+
run every lane, so a Dependabot bump of mypy would start the whole test matrix. Set the list explicitly whenever the
|
|
152
|
+
repository has a requirements file the tests do not install (a docs site's, a type-check, lint or release one),
|
|
153
|
+
naming only what the tests do use, and add files the built-in list lacks, such as `noxfile.py` or a `constraints/`
|
|
154
|
+
directory. For example, tests installed from `pyproject.toml` through tox, beside a `requirements-mypy.txt`:
|
|
155
|
+
`"graph": {"global_inputs": ["pyproject.toml", "tox.ini"], ...}`. Prove it with a routing-test row
|
|
156
|
+
(`("requirements-mypy.txt", NONE)`, step 6).
|
|
143
157
|
- **Top-level `global_inputs`** are CI execution files whose change must run every lane. Omitted, they are every
|
|
144
158
|
non-Markdown file under `.github/` plus `graph.global_inputs`, so a `dependabot.yml` or release-workflow edit would
|
|
145
159
|
run everything. An explicit list replaces that: name the lane config, the workflows that run lane jobs, local
|
|
@@ -150,20 +164,22 @@ Adapt every path; this is a shape, not an inventory. The rules:
|
|
|
150
164
|
|
|
151
165
|
Add `.test-impact/` to `.gitignore`: the planner keeps its graph cache there.
|
|
152
166
|
|
|
153
|
-
**Collection policy.** If pytest configuration exists (`
|
|
154
|
-
`[
|
|
167
|
+
**Collection policy.** If pytest configuration exists (`pyproject.toml`, `pytest.ini`, `pytest.toml`, a `tox.ini`
|
|
168
|
+
with `[pytest]`, a `setup.cfg` with `[tool:pytest]`), the planner runs every lane until you record its fingerprints
|
|
155
169
|
(`full-suite fallback: pytest configuration changed; review collection policy and refresh its fingerprints`). Review
|
|
156
170
|
the pytest settings and collection hooks, commit the config, then:
|
|
157
171
|
|
|
158
172
|
```bash
|
|
159
|
-
|
|
173
|
+
mkdir -p .test-impact
|
|
174
|
+
python -c "import json; print(json.dumps(json.load(open('.github/test-lanes.json'))['graph']))" > .test-impact/graph.json
|
|
160
175
|
uv run --no-project --with "pytest-selective==$VERSION" \
|
|
161
|
-
pytest-selective fingerprints --config /
|
|
176
|
+
pytest-selective fingerprints --config .test-impact/graph.json --head HEAD
|
|
162
177
|
```
|
|
163
178
|
|
|
164
|
-
Copy the printed object into `graph.pytest_policy` and commit.
|
|
165
|
-
|
|
166
|
-
|
|
179
|
+
Copy the printed object into `graph.pytest_policy` and commit. Releases up to 1.1.1 also print a `tox.ini` or
|
|
180
|
+
`setup.cfg` that has no pytest section (pytest ignores it); keeping that entry is harmless. Without uv, run the same
|
|
181
|
+
commands in a virtual environment after `python -m pip install "pytest-selective==$VERSION"`. When pytest settings
|
|
182
|
+
change later, the planner falls back to every lane until someone reviews and refreshes the fingerprints.
|
|
167
183
|
|
|
168
184
|
### Prove the config locally
|
|
169
185
|
|
|
@@ -177,15 +193,18 @@ uv run --no-project --with "pytest-selective==$VERSION" \
|
|
|
177
193
|
Expected: JSON with `lanes` (one boolean per lane), `reason` and `lane_reasons`. A README edit gives every lane
|
|
178
194
|
`false` (or only `package`, when the build embeds the README) with `no affected tests or changed inputs`; a source
|
|
179
195
|
edit selects the lanes of the tests that import it (`affected test: tests/test_x.py`); a lockfile or workflow edit
|
|
180
|
-
selects every lane (`global input: ...`). Probe a
|
|
181
|
-
|
|
196
|
+
selects every lane (`global input: ...`). Probe a prose-only file that no lane covers (a docs page; without a `docs/`
|
|
197
|
+
directory, a CHANGELOG, RELEASING or CONTRIBUTING file, or the README unless the package lane embeds it), each
|
|
198
|
+
requirements file, a source module, a test, a benchmark, a nested file in each directory you narrowed, and each
|
|
199
|
+
workflow. If a source edit selects every lane
|
|
182
200
|
(`all graph test files affected`), every test reaches it, often through a package `__init__.py`: correct, not a misroute.
|
|
183
201
|
|
|
184
202
|
## 4. Wire the workflows
|
|
185
203
|
|
|
186
204
|
### 4.1 The planner job
|
|
187
205
|
|
|
188
|
-
Add to each workflow that runs lane jobs
|
|
206
|
+
Add to each workflow that runs lane jobs. The snippets in this file write third-party actions as `@vN`; use the
|
|
207
|
+
repository's own ref for each one instead (its SHA and `# vX.Y.Z` comment, when it pins SHAs):
|
|
189
208
|
|
|
190
209
|
```yaml
|
|
191
210
|
select-tests:
|
|
@@ -198,14 +217,19 @@ Add to each workflow that runs lane jobs, using the repository's own pin for `ac
|
|
|
198
217
|
fetch-depth: 0 # the planner needs the base commit
|
|
199
218
|
persist-credentials: false
|
|
200
219
|
- id: plan
|
|
201
|
-
uses: gigaverse-app/pytest-selective/actions/plan-lanes@
|
|
220
|
+
uses: gigaverse-app/pytest-selective/actions/plan-lanes@v1 # or step 1's SHA pin
|
|
202
221
|
with:
|
|
203
222
|
config: .github/test-lanes.json
|
|
204
223
|
```
|
|
205
224
|
|
|
206
225
|
`full` defaults to `auto`: pull requests and pushes select; `workflow_dispatch`, `workflow_call`, `schedule` and
|
|
207
226
|
`release` events, and pull requests labelled `test:full`, run every lane. Reruns keep the first attempt's selection.
|
|
208
|
-
Keep (or propose) a scheduled full run
|
|
227
|
+
Keep (or propose) a scheduled full run, and make sure each workflow with lane jobs has `workflow_dispatch:`: it is
|
|
228
|
+
how you start a full control in step 8.
|
|
229
|
+
|
|
230
|
+
The action also uploads its plan as a `test-lane-selection` artifact, which
|
|
231
|
+
[CI-esta](https://github.com/gigaverse-app/ci-esta) renders. Give each planner job in one workflow run its own
|
|
232
|
+
`artifact-name`, or set `artifact-name: ''` to skip the upload; the plan and the `lanes` output stay the same.
|
|
209
233
|
|
|
210
234
|
### 4.2 Gate each lane job
|
|
211
235
|
|
|
@@ -229,20 +253,22 @@ together. A job with other needs must check them itself, because `always()` also
|
|
|
229
253
|
`push: branches: [DEFAULT]`. If the repository wants branch pushes, give the planner a base for new branches:
|
|
230
254
|
`base: ${{ github.event.pull_request.base.sha || (github.event.created && format('origin/{0}', github.event.repository.default_branch)) || github.event.before }}`.
|
|
231
255
|
Changing triggers is a behavior change: say so in the pull request.
|
|
256
|
+
- **Probe branches before the merge.** With branch pushes kept, each probe branch's first push (step 7) plans
|
|
257
|
+
against DEFAULT, which does not have your workflow change yet, so it runs every lane. That full run is not a
|
|
258
|
+
misroute and costs a matrix per probe. Make it useful or stop it: the docs-only probe's push runs are a full
|
|
259
|
+
control at the probe head (step 8), so keep them; cancel the source probe's push runs as soon as they start
|
|
260
|
+
(`gh run cancel RUN --repo "$REPO"`) and judge that probe by its `pull_request` runs. The cost ends once the
|
|
261
|
+
adoption merges.
|
|
232
262
|
- **`branches:` filters.** A probe pull request opened against your adoption branch does not start workflows filtered
|
|
233
263
|
to `pull_request: branches: [main]`. Prove those workflows with routing tests and local plans, and say in the report
|
|
234
264
|
that their hosted probe waits for the merge.
|
|
235
265
|
|
|
236
266
|
### 4.4 Jobs on a publish path
|
|
237
267
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
2. Keep the needed job running on every other event:
|
|
243
|
-
`${{ always() && !cancelled() && (github.event_name != 'pull_request' || needs.select-tests.result != 'success' || fromJSON(needs.select-tests.outputs.lanes).package) }}`.
|
|
244
|
-
3. Admit steps, not the job: the job always runs and succeeds, so its dependents still run, and only its expensive
|
|
245
|
-
steps skip. Plan inside the job and let a failed plan run everything:
|
|
268
|
+
One rule: a job that a publish or deploy job `needs:`, directly or transitively, is never skipped, because a skipped
|
|
269
|
+
job skips its dependents and so the publication. Leave it ungated, as it is. If it is expensive and you want pull
|
|
270
|
+
requests to skip that work, admit its steps instead of the job: the job always runs and succeeds, so its dependents
|
|
271
|
+
still run, and only the expensive steps skip. Plan inside the job and let a failed plan run everything:
|
|
246
272
|
|
|
247
273
|
```yaml
|
|
248
274
|
steps:
|
|
@@ -252,7 +278,7 @@ publishes. Use one of these, in order of preference:
|
|
|
252
278
|
persist-credentials: false
|
|
253
279
|
- id: plan
|
|
254
280
|
continue-on-error: true # a failed plan runs the steps below
|
|
255
|
-
uses: gigaverse-app/pytest-selective/actions/plan-lanes@
|
|
281
|
+
uses: gigaverse-app/pytest-selective/actions/plan-lanes@v1
|
|
256
282
|
with:
|
|
257
283
|
config: .github/test-lanes.json
|
|
258
284
|
artifact-name: ''
|
|
@@ -260,7 +286,8 @@ publishes. Use one of these, in order of preference:
|
|
|
260
286
|
run: python -m build && python -m twine check --strict dist/*
|
|
261
287
|
```
|
|
262
288
|
|
|
263
|
-
Keep the steps that produce what the publish job downloads unconditional.
|
|
289
|
+
Keep the steps that produce what the publish job downloads unconditional. Every other job that installs, builds or
|
|
290
|
+
tests is gated as in 4.2.
|
|
264
291
|
|
|
265
292
|
## 5. Add the gate
|
|
266
293
|
|
|
@@ -274,7 +301,7 @@ check:
|
|
|
274
301
|
if: ${{ !cancelled() }}
|
|
275
302
|
runs-on: ubuntu-latest
|
|
276
303
|
steps:
|
|
277
|
-
- uses: gigaverse-app/pytest-selective/actions/validation-gate@
|
|
304
|
+
- uses: gigaverse-app/pytest-selective/actions/validation-gate@v1
|
|
278
305
|
with:
|
|
279
306
|
needs: ${{ toJSON(needs) }}
|
|
280
307
|
lanes: ${{ needs.select-tests.outputs.lanes || '{}' }}
|
|
@@ -283,10 +310,8 @@ check:
|
|
|
283
310
|
|
|
284
311
|
It passes only when every prerequisite succeeded, or was skipped while the planner succeeded and every lane mapped to
|
|
285
312
|
that job is `false`. A failed, cancelled or skipped planner, a failed job, or a skip of an unmapped job fails it. It
|
|
286
|
-
installs nothing. If the repository already has an aggregate job, keep its name and replace its logic with
|
|
287
|
-
`
|
|
288
|
-
`gh api "repos/gigaverse-app/pytest-selective/contents/actions/validation-gate/action.yml?ref=$TAG"` returns 404, use
|
|
289
|
-
`gigaverse-app/ci-esta/actions/validation-gate@v1` with the same inputs.
|
|
313
|
+
installs nothing. If the repository already has an aggregate job, keep its job id and name and replace its logic with
|
|
314
|
+
this step; the routing test's `GATE` names that id (step 6).
|
|
290
315
|
|
|
291
316
|
## 6. Add routing tests
|
|
292
317
|
|
|
@@ -308,7 +333,7 @@ only what they need there:
|
|
|
308
333
|
- uses: actions/setup-python@v7
|
|
309
334
|
with:
|
|
310
335
|
python-version: '3.13'
|
|
311
|
-
- run: python -m pip install "pytest-selective
|
|
336
|
+
- run: python -m pip install "pytest-selective>=VERSION,<2" # brings pytest and PyYAML; ==VERSION with SHA pins
|
|
312
337
|
- run: python -m pytest ci_tests -q
|
|
313
338
|
```
|
|
314
339
|
|
|
@@ -319,11 +344,14 @@ only what they need there:
|
|
|
319
344
|
would run every lane; list it in `graph.global_inputs` only if tests really use it.
|
|
320
345
|
- pre-commit and prek only check tracked files: `git add` new files before running the hooks.
|
|
321
346
|
|
|
322
|
-
Start from this file, `ci_tests/test_ci_routing.py
|
|
347
|
+
Start from this file, `ci_tests/test_ci_routing.py`. Adapt the rows, `WORKFLOW` and `GATE`; the fixture copies
|
|
348
|
+
every tracked file, so a misroute cannot hide behind a file the test forgot to copy:
|
|
323
349
|
|
|
324
350
|
```python
|
|
325
351
|
"""Route real Git changes through the committed lane config (pytest-selective)."""
|
|
326
352
|
|
|
353
|
+
from __future__ import annotations
|
|
354
|
+
|
|
327
355
|
import json
|
|
328
356
|
import shutil
|
|
329
357
|
import subprocess
|
|
@@ -337,8 +365,10 @@ ROOT = Path(__file__).resolve().parents[1]
|
|
|
337
365
|
CONFIG = LaneConfig.model_validate_json((ROOT / ".github/test-lanes.json").read_text(encoding="utf-8"))
|
|
338
366
|
EVERY = dict.fromkeys(CONFIG.lanes, True)
|
|
339
367
|
NONE = dict.fromkeys(CONFIG.lanes, False)
|
|
340
|
-
|
|
341
|
-
|
|
368
|
+
WORKFLOW = ROOT / ".github/workflows/test.yml"
|
|
369
|
+
PLANNER = "select-tests"
|
|
370
|
+
# The gate job's id. Keep an existing aggregate job's id, for example "success".
|
|
371
|
+
GATE = "gate"
|
|
342
372
|
|
|
343
373
|
|
|
344
374
|
def git(repo: Path, *args: str) -> str:
|
|
@@ -354,19 +384,26 @@ def commit(repo: Path) -> str:
|
|
|
354
384
|
|
|
355
385
|
@pytest.fixture
|
|
356
386
|
def repo(tmp_path: Path) -> Path:
|
|
387
|
+
"""A copy of every tracked file, so no file the planner reads can be missing from the fixture."""
|
|
357
388
|
git(tmp_path, "init", "--quiet")
|
|
358
|
-
for path in
|
|
359
|
-
|
|
360
|
-
|
|
389
|
+
for path in git(ROOT, "ls-files", "-z").split("\0"):
|
|
390
|
+
source, target = ROOT / path, tmp_path / path
|
|
391
|
+
# Skips the empty tail, submodules and files deleted in the working tree.
|
|
392
|
+
if path and (source.is_symlink() or source.is_file()):
|
|
393
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
394
|
+
shutil.copyfile(source, target, follow_symlinks=False)
|
|
361
395
|
return tmp_path
|
|
362
396
|
|
|
363
397
|
|
|
364
398
|
@pytest.mark.parametrize(
|
|
365
|
-
"path, expected",
|
|
399
|
+
("path", "expected"),
|
|
366
400
|
[
|
|
367
401
|
("README.md", {**NONE, "package": True}),
|
|
402
|
+
# Prose no lane covers; without docs/, use CHANGELOG.md or RELEASING.md.
|
|
368
403
|
("docs/index.md", NONE),
|
|
369
|
-
|
|
404
|
+
# Requirements the tests do not install, narrowed out of graph.global_inputs.
|
|
405
|
+
("docs/requirements.txt", NONE),
|
|
406
|
+
("requirements-mypy.txt", NONE),
|
|
370
407
|
("tests/test_other.py", {**NONE, "tests": True}),
|
|
371
408
|
("src/toy/other.py", {**NONE, "tests": True, "package": True}),
|
|
372
409
|
("tests/benchmarks/test_bench.py", {**NONE, "tests": True, "bench": True}),
|
|
@@ -377,9 +414,7 @@ def repo(tmp_path: Path) -> Path:
|
|
|
377
414
|
)
|
|
378
415
|
def test_a_change_runs_exactly_its_lanes(repo: Path, path: str, expected: dict[str, bool]) -> None:
|
|
379
416
|
base = commit(repo)
|
|
380
|
-
|
|
381
|
-
target.parent.mkdir(parents=True, exist_ok=True)
|
|
382
|
-
with target.open("a", encoding="utf-8") as handle:
|
|
417
|
+
with (repo / path).open("a", encoding="utf-8") as handle:
|
|
383
418
|
handle.write("\n# routing probe\n")
|
|
384
419
|
result = plan(repo, CONFIG, base, commit(repo))
|
|
385
420
|
assert result.lanes == expected, result.lane_reasons
|
|
@@ -387,43 +422,54 @@ def test_a_change_runs_exactly_its_lanes(repo: Path, path: str, expected: dict[s
|
|
|
387
422
|
|
|
388
423
|
def test_missing_history_and_full_checkpoints_run_every_lane(repo: Path) -> None:
|
|
389
424
|
head = commit(repo)
|
|
390
|
-
|
|
425
|
+
# No previous commit, as on a new branch's first push.
|
|
426
|
+
assert plan(repo, CONFIG, "0" * 40, head).lanes == EVERY
|
|
391
427
|
assert plan(repo, CONFIG, head, head, full=True).lanes == EVERY
|
|
392
428
|
|
|
393
429
|
|
|
394
430
|
def test_the_gate_guards_every_job_and_lane_jobs_run_when_planning_fails() -> None:
|
|
395
|
-
workflow = yaml.safe_load(
|
|
396
|
-
|
|
431
|
+
workflow = yaml.safe_load(WORKFLOW.read_text(encoding="utf-8"))
|
|
432
|
+
# PyYAML reads the `on:` key as the boolean True.
|
|
433
|
+
assert "pull_request" in workflow[True]
|
|
397
434
|
jobs = workflow["jobs"]
|
|
398
|
-
(step,) = [step for step in jobs[
|
|
435
|
+
(step,) = [step for step in jobs[GATE]["steps"] if "validation-gate" in step.get("uses", "")]
|
|
399
436
|
lane_jobs = json.loads(step["with"]["lane-jobs"])
|
|
400
|
-
assert set(jobs[
|
|
437
|
+
assert set(jobs[GATE]["needs"]) == set(jobs) - {GATE}
|
|
401
438
|
assert {lane for lanes in lane_jobs.values() for lane in lanes} <= set(CONFIG.lanes)
|
|
439
|
+
gated = {name for name, job in jobs.items() if f"needs.{PLANNER}.outputs.lanes" in str(job.get("if", ""))}
|
|
440
|
+
# Every job that a lane admits is in the gate's lane map, and nothing else is.
|
|
441
|
+
assert set(lane_jobs) == gated
|
|
402
442
|
for job, lanes in lane_jobs.items():
|
|
403
443
|
condition = " ".join(jobs[job]["if"].split())
|
|
404
444
|
assert "always() && !cancelled()" in condition, job
|
|
405
|
-
assert "needs.
|
|
406
|
-
assert all(f"fromJSON(needs.
|
|
445
|
+
assert f"needs.{PLANNER}.result != 'success'" in condition, job
|
|
446
|
+
assert all(f"fromJSON(needs.{PLANNER}.outputs.lanes).{lane}" in condition for lane in lanes), job
|
|
407
447
|
```
|
|
408
448
|
|
|
409
|
-
Add a row for every directory you narrowed, every requirements file, each workflow and each lane
|
|
410
|
-
comment; a `<workflow>#<job>` input ignores comments, so edit the job itself in that row.
|
|
411
|
-
|
|
449
|
+
Add a row for every directory you narrowed, every requirements file, each workflow and each lane, using real tracked
|
|
450
|
+
paths. A row appends a comment; a `<workflow>#<job>` input ignores comments, so edit the job itself in that row. With
|
|
451
|
+
several workflows, repeat the gate test per workflow with its own `GATE`. Make the file pass the repository's own
|
|
452
|
+
linters, formatter and type checker before committing: for example, ruff's `required-imports` may demand
|
|
453
|
+
`from __future__ import annotations` (the template has it), and black or `ruff format` with a shorter line length
|
|
454
|
+
reflows it. Run it locally with `uv run --no-project --with "pytest-selective==$VERSION" pytest ci_tests -q` and
|
|
455
|
+
commit it.
|
|
412
456
|
|
|
413
457
|
## 7. Prove it on hosted CI
|
|
414
458
|
|
|
415
459
|
1. Push the branch and open the draft pull request. Its first run changes workflows, so every lane runs: that is the
|
|
416
460
|
full baseline, not a misroute.
|
|
417
|
-
2. Branch from the adoption branch, edit only
|
|
418
|
-
against the adoption branch (mind
|
|
461
|
+
2. Branch from the adoption branch, edit only prose no lane covers (a docs page and a README line; without a `docs/`
|
|
462
|
+
directory, a CHANGELOG or RELEASING line), push, and open a probe pull request against the adoption branch (mind
|
|
463
|
+
4.3's `branches:` filters, and its note on the probe's own push runs). List what the pull request executed:
|
|
419
464
|
|
|
420
465
|
```bash
|
|
421
|
-
gh run list --repo "$REPO" --branch PROBE_BRANCH --json databaseId,workflowName,conclusion
|
|
466
|
+
gh run list --repo "$REPO" --branch PROBE_BRANCH --event pull_request --json databaseId,workflowName,conclusion
|
|
422
467
|
gh run view RUN --repo "$REPO" --json jobs --jq '.jobs[] | [.name, .conclusion] | @tsv'
|
|
423
468
|
```
|
|
424
469
|
|
|
425
|
-
Expected: the planner, lint, docs, the `package` lane only if the build embeds the README,
|
|
426
|
-
other lane job is `skipped`; the gate succeeded.
|
|
470
|
+
Expected: the planner, lint, docs, the `package` lane only if the build embeds the README, the jobs a publish job
|
|
471
|
+
needs (4.4), and the gate ran; every other lane job is `skipped`; the gate succeeded. Any other job that installs,
|
|
472
|
+
builds or tests and still ran is a missed gate: gate it as in 4.2.
|
|
427
473
|
3. Repeat with a one-line source change: its lanes run in full, the rest skip.
|
|
428
474
|
4. Keep the probe pull requests open until you have measured, then close them without merging and delete their
|
|
429
475
|
branches.
|
|
@@ -432,18 +478,26 @@ comment; a `<workflow>#<job>` input ignores comments, so edit the job itself in
|
|
|
432
478
|
|
|
433
479
|
Compare a selected run with a full control **at the same head**:
|
|
434
480
|
|
|
435
|
-
- Selected: the docs-only probe's runs.
|
|
436
|
-
- Full control:
|
|
437
|
-
|
|
438
|
-
every lane
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
481
|
+
- Selected: the docs-only probe's `pull_request` runs.
|
|
482
|
+
- Full control: if the probe branch's push runs already ran every lane at the probe head (4.3), use them. Otherwise
|
|
483
|
+
dispatch every workflow the selected side ran, on the probe branch; `workflow_dispatch` plans a full checkpoint, so
|
|
484
|
+
every lane runs:
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
gh workflow run WORKFLOW --repo "$REPO" --ref PROBE_BRANCH # once per workflow
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
GitHub dispatches only workflows whose file exists on DEFAULT, and may read the trigger from there: if a workflow
|
|
491
|
+
gains `workflow_dispatch:` only in your adoption and the dispatch is refused, measure after the merge. A rerun is
|
|
492
|
+
not a control: it keeps the selection. Do not wait on a `test:full` label; creating one is the human's step 9.
|
|
493
|
+
|
|
494
|
+
Both sides then share a head SHA: a `pull_request` run records the branch head as its `head_sha`, although it checks
|
|
495
|
+
out the merge commit, and a dispatch or push run on the branch records the same commit. Record both checked-out SHAs.
|
|
442
496
|
|
|
443
497
|
```bash
|
|
444
498
|
gh run list --repo "$REPO" --commit HEAD_SHA --json databaseId,workflowName,event,conclusion,createdAt
|
|
445
|
-
uv run --no-project https://raw.githubusercontent.com/gigaverse-app/pytest-selective/
|
|
446
|
-
"$REPO" --selected RUN_A RUN_B --full RUN_C RUN_D --output comparison.json
|
|
499
|
+
uv run --no-project https://raw.githubusercontent.com/gigaverse-app/pytest-selective/v1/scripts/measure_ci_runs.py \
|
|
500
|
+
"$REPO" --selected RUN_A RUN_B --full RUN_C RUN_D --output .test-impact/comparison.json
|
|
447
501
|
```
|
|
448
502
|
|
|
449
503
|
List every workflow run of each side (it adds runner-seconds across workflows and spans elapsed time from the first
|
|
@@ -459,7 +513,8 @@ and label hosted impact unmeasured.
|
|
|
459
513
|
Leave these to the human and list them in the pull request:
|
|
460
514
|
|
|
461
515
|
- Make each workflow's gate job a required check, and remove required checks for jobs that can now be skipped.
|
|
462
|
-
- Create the `test:full` label, if it does not exist
|
|
516
|
+
- Create the `test:full` label, if it does not exist: adding it to a pull request and then closing and reopening the
|
|
517
|
+
pull request runs every lane (adding a label alone starts nothing unless a workflow lists `labeled`).
|
|
463
518
|
- Approve any trigger change from 4.3 and a scheduled full run.
|
|
464
519
|
- Merge. Then a docs-only pull request against the default branch proves the workflows that 4.3's filters hid.
|
|
465
520
|
|
|
@@ -470,7 +525,8 @@ Use this in the pull request body, filled in:
|
|
|
470
525
|
```markdown
|
|
471
526
|
## pytest-selective adoption
|
|
472
527
|
|
|
473
|
-
pytest-selective vX.Y.Z: actions at
|
|
528
|
+
pytest-selective vX.Y.Z: actions at `@v1` (or `@<sha> # vX.Y.Z` where tags are rejected), routing tests install
|
|
529
|
+
`pytest-selective>=X.Y.Z,<2`.
|
|
474
530
|
|
|
475
531
|
| Lane | Jobs it admits | Roots and inputs |
|
|
476
532
|
| --- | --- | --- |
|