Follow-up to DEVX-41. Fixes two issues discovered when infra badges still showed "unknown":
Test paths hardcoded to tests/ — infra has testpaths = ["scripts/tests", "tests/unit"] in pyproject.toml. The old code only looked for tests/ directory, missing scripts/tests/. Now detect_testpaths() parses testpaths from pyproject.toml and resolves them against the repo root.
Warnings only showed stderr — pytest writes errors to stdout, not stderr. When infra pytest failed with rc=2, the warning showed pytest stderr: (empty). Now warnings show the last 300 chars of both stdout and stderr.
Changes
detect_testpaths() — new function, parses testpaths from [tool.pytest.ini_options] in pyproject.toml, filters to existing paths, falls back to tests/ dir, then empty list
collect_coverage_and_tests() — uses detect_testpaths(), logs test paths, warnings show both stdout and stderr
Tests: 5 new tests for detect_testpaths(), updated TestCollectCoverageAndTests to mock detect_testpaths
Closes DEVX-42
## Summary
Follow-up to DEVX-41. Fixes two issues discovered when infra badges still showed "unknown":
1. **Test paths hardcoded to `tests/`** — infra has `testpaths = ["scripts/tests", "tests/unit"]` in pyproject.toml. The old code only looked for `tests/` directory, missing `scripts/tests/`. Now `detect_testpaths()` parses `testpaths` from pyproject.toml and resolves them against the repo root.
2. **Warnings only showed stderr** — pytest writes errors to stdout, not stderr. When infra pytest failed with rc=2, the warning showed `pytest stderr: ` (empty). Now warnings show the last 300 chars of both stdout and stderr.
### Changes
- `detect_testpaths()` — new function, parses `testpaths` from `[tool.pytest.ini_options]` in pyproject.toml, filters to existing paths, falls back to `tests/` dir, then empty list
- `collect_coverage_and_tests()` — uses `detect_testpaths()`, logs test paths, warnings show both stdout and stderr
- Tests: 5 new tests for `detect_testpaths()`, updated `TestCollectCoverageAndTests` to mock `detect_testpaths`
Closes DEVX-42
Documentation: WARNING — source files changed but no docs updated
Tests: OK
Commit conventions: OK
No issues found by automated checks.
Auto-merge: If all CI checks pass, this PR will be merged automatically.
## Automated PR Review
- Architecture compliance: OK
- Best practices: OK
- Security: OK
- i18n: OK
- Resource management: OK
- Documentation: WARNING — source files changed but no docs updated
- Tests: OK
- Commit conventions: OK
No issues found by automated checks.
---
**Auto-merge:** If all CI checks pass, this PR will be merged automatically.
Documentation: WARNING — source files changed but no docs updated
Tests: OK
Commit conventions: OK
No issues found by automated checks.
Auto-merge: If all CI checks pass, this PR will be merged automatically.
## Automated PR Review
- Architecture compliance: OK
- Best practices: OK
- Security: OK
- i18n: OK
- Resource management: OK
- Documentation: WARNING — source files changed but no docs updated
- Tests: OK
- Commit conventions: OK
No issues found by automated checks.
---
**Auto-merge:** If all CI checks pass, this PR will be merged automatically.
emil
merged commit 7dcb9c03c0 into master2026-06-24 20:55:36 +00:00
emil
deleted branch DEVX-42-fix-badge-testpaths2026-06-24 20:55:37 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Follow-up to DEVX-41. Fixes two issues discovered when infra badges still showed "unknown":
Test paths hardcoded to
tests/— infra hastestpaths = ["scripts/tests", "tests/unit"]in pyproject.toml. The old code only looked fortests/directory, missingscripts/tests/. Nowdetect_testpaths()parsestestpathsfrom pyproject.toml and resolves them against the repo root.Warnings only showed stderr — pytest writes errors to stdout, not stderr. When infra pytest failed with rc=2, the warning showed
pytest stderr:(empty). Now warnings show the last 300 chars of both stdout and stderr.Changes
detect_testpaths()— new function, parsestestpathsfrom[tool.pytest.ini_options]in pyproject.toml, filters to existing paths, falls back totests/dir, then empty listcollect_coverage_and_tests()— usesdetect_testpaths(), logs test paths, warnings show both stdout and stderrdetect_testpaths(), updatedTestCollectCoverageAndTeststo mockdetect_testpathsCloses DEVX-42
Automated PR Review
No issues found by automated checks.
Auto-merge: If all CI checks pass, this PR will be merged automatically.
49041b7fd5to3152b0fbccAutomated PR Review
No issues found by automated checks.
Auto-merge: If all CI checks pass, this PR will be merged automatically.