mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 14:43:01 +02:00
_affected_packages() now ignores subpackages whose tests/ dir doesn't exist on disk and stops returning None for stray root-level files left over from rewritten history. Pre-push pytest scope is bounded to the 6 packages with real test suites instead of every diverged path.
27 lines
1.4 KiB
JSON
27 lines
1.4 KiB
JSON
{
|
|
"intent": "Tighten pre-push pytest scope so it only runs tests for python_pkg subpackages that actually have a tests/ directory, preventing wasted runs and OOM during force-push.",
|
|
"scope": [
|
|
"scripts/pytest_changed_packages.py",
|
|
"Non-goal: changing mypy/pylint/bandit/prettier hook scoping"
|
|
],
|
|
"changes": [
|
|
"_affected_packages() now filters out subpackage names whose python_pkg/<pkg>/tests/ directory does not exist on disk (covers deleted packages left over in rewritten history).",
|
|
"Root-level python_pkg/<file>.py paths only trigger run-all when the file exists AND is conftest.py or __init__.py; stray root files from rewritten history are now silently skipped instead of running the full suite."
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "python -c 'from pytest_changed_packages import _affected_packages; ...'",
|
|
"result": "pass",
|
|
"evidence": "deleted-only paths -> set(); valid pkg path -> {steam_backlog_enforcer}; stray python_pkg/geo_data.py -> set(); existing python_pkg/conftest.py -> None (run all)."
|
|
}
|
|
],
|
|
"risks": [
|
|
"If a future package is added without a tests/ dir, it will be silently skipped on push.",
|
|
"Stray python_pkg/<name>.py files added in the future would no longer trigger run-all unless they are conftest.py or __init__.py."
|
|
],
|
|
"rollback": [
|
|
"git revert <this-commit>",
|
|
"Re-run pre-commit run --hook-stage pre-push --all-files to confirm prior behavior."
|
|
]
|
|
}
|