Skip to content

testing: include offending values in validation error messages - #79

Merged
kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
ayam04:fix/validation-errors-include-value
Aug 21, 2026
Merged

testing: include offending values in validation error messages#79
kstonekuan merged 1 commit into
Hebbian-Robotics:mainfrom
ayam04:fix/validation-errors-include-value

Conversation

@ayam04

@ayam04 ayam04 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What changed

Four validation errors now include the offending value(s), matching the pattern already used by every other raise in _validate_video_episode_spec (e.g. source_start_s must be >= 0, got ...):

  • src/hflow/testing.pycamera_name must not be empty, got {spec.camera_name!r} (the check is .strip()-based, so "" vs " " is exactly the distinction the message should surface)
  • src/hflow/testing.pyblack_segment and freeze_segment must not overlap, got {spec.black_segment!r} and {spec.freeze_segment!r}
  • src/hflow/steps.pydeclared step version must not be empty for step {name!r} (the optional stretch named in the issue; name is in scope)
  • src/hflow/app.pyderived channel topic must not be empty, got {topic!r} (optional stretch)

No test asserts these strings (per the issue), so nothing else needed updating.

Validation

uv run ruff check src/hflow/testing.py src/hflow/steps.py src/hflow/app.py   # All checks passed!
uv run ruff format --check ...                                               # already formatted
uv run ty check                                                              # All checks passed!
uv run pytest -q                                                             # 298 passed, 3 skipped

tests/test_ffmpeg.py shows 3 failed, 6 errors both on this branch and on clean main (verified in a detached worktree) — pre-existing WSL/environment ffmpeg-binary detection issues, unaffected by this change.

Fixes #65

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ayam04, and welcome! You took the optional stretch sites as well as the two required ones, and the messages read the way the rest of the codebase does.

What I validated locally:

  • Full quality gate is clean (ruff check, ruff format --check, ty check) and all 307 tests pass.
  • Re-ran the gate on your branch merged with current main, since #77 landed a change to testing.py a few minutes ago. It merges cleanly and stays green, so no rebase needed on your side.
  • Confirmed name is in scope at the steps.py site (it is the first parameter of compute_check_version) and that no test asserts the old message strings.

On the tests/test_ffmpeg.py failures you saw: those are environment, not your change. Those tests need real ffmpeg/ffprobe binaries on PATH, and they pass here. Thank you for checking against a clean worktree before reporting it; that is exactly the right instinct, and it saved me from wondering.

Nice detail: keeping camera_name on !r so "" and " " read differently in the message. That was the whole point of that one.

Merging now. The open good first issues have plenty left if you want another (issues with an assignee are taken; everything else is fair game), and we hang out on Discord.

@kstonekuan
kstonekuan merged commit 7cd6dc2 into Hebbian-Robotics:main Aug 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

testing.py: two validation errors omit the offending value

2 participants