DEVX-42: Fix badge testpaths detection and warning output #66

Merged
emil merged 0 commits from DEVX-42-fix-badge-testpaths into master 2026-06-24 20:55:36 +00:00
Owner

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

## 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
emil reviewed 2026-06-24 20:53:13 +00:00
emil left a comment
Author
Owner

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.

## 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 force-pushed DEVX-42-fix-badge-testpaths from 49041b7fd5 to 3152b0fbcc 2026-06-24 20:54:11 +00:00 Compare
emil reviewed 2026-06-24 20:54:44 +00:00
emil left a comment
Author
Owner

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.

## 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 master 2026-06-24 20:55:36 +00:00
emil deleted branch DEVX-42-fix-badge-testpaths 2026-06-24 20:55:37 +00:00
Sign in to join this conversation.