Repository navigation
fix: propagate RUN_ONCE exit status and align behave suite - #97
Merged
Merged
Conversation
Rework the behave suite to follow skills/behave-behavioral-testing: - compare whole file and request sets, with observed values in failure messages; remove guards that let assertions pass vacuously - group step modules by function and share helpers in features/lib - rewrite Gherkin in the active voice with feature descriptions - run the fake dashcam on an ephemeral loopback port with a real shutdown; record requests and arm download and listing failures - own fixture lifetimes through context.add_cleanup and keep only failed scenarios' directories and run logs - add scenarios for listing errors, grouping, partial downloads, and syncing against a partially populated destination Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz
entrypoint.sh ended with an if statement without else, so a RUN_ONCE container always exited 0. The script now keeps the sync status and exits with it. Cron mode is unchanged and still starts crond after the first sync. With exit codes visible in docker mode, the listing-error scenario runs there too. The behave suite now requires behave 1.3.3: it uses tag expressions v2 and active tags (@use.with_protocol=legacy) in place of the hand-written skips. mypy ignores the missing behave stubs, so local runs match the pre-commit hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz
Delete the root and features/ CLAUDE.md files, which only imported AGENTS.md, and drop a comment in entrypoint.sh that restated the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz
Make PyHamcrest's assert_that() the preferred way to state conditions in the unit-test authoring and review skills and in the behave skill. A plain assert remains for a condition that no matcher states, and matchers that pass for a partial value do not satisfy the whole-value rule. Restore hamcrest in the behave steps, which an earlier rework had switched to plain assert. The whole-value comparisons stay, with the set differences and the run output passed as the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz
Reword the step that compares downloaded files with the "mock fixture" to say that they match the files on the dashcam, and describe the partial download as a truncated dashcam video. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Rework the behave suite so it follows
skills/behave-behavioral-testing/SKILL.md, and fix the exit status of theDocker image. Each review and each fix of the suite ran in a separate agent.
The loop stopped when a fresh review found no major problems.
With
RUN_ONCEset,entrypoint.shalways exited 0, because the scriptended with an
ifstatement withoutelse. A failed sync looked like asuccess to whatever started the container, and in docker mode no behave
check of the exit code could fail. The script now keeps the sync status and
exits with it. Cron mode is unchanged: crond starts after the first sync,
whatever its result.
Several checks could pass without testing anything. Three destination checks
returned early when a setup step was missing, and most checks tested only a
subset of the files. All checks now compare the whole set of files in the
destination, or the whole set of requests that the fake dashcam received. A
failed check prints the missing and the unexpected files. The exit code check
prints the output of blackvuesync.
Step modules are now grouped by function: blackvuesync runs, the dashcam, the
destination, and general checks. One step,
blackvuesync runs with ...,replaces six. The Gherkin uses the active voice, and each feature has a short
description.
The fake dashcam listens on a random port on 127.0.0.1 and shuts down at the
end of the run. It records the files that blackvuesync requests. A scenario
can make it fail a download or the recording list. Cleanup goes through
context.add_cleanup. When a scenario fails, the run keeps only the directoryof that scenario, with its destination and a log of each blackvuesync run.
New scenarios cover a failed recording list (exit code 2), daily and weekly
grouping, leftover partial downloads, and a destination that already has some
of the dashcam recordings. A step that backdates the failure markers replaces
a 2-second sleep.
The suite now requires behave 1.3.3, the latest release. It uses tag
expressions v2 (
not @ignore) and active tags (@use.with_protocol=legacy)in place of the hand-written skips. Fixtures, the
Rulekeyword, andcucumber expressions did not make this suite simpler, so the suite does not
use them. mypy now ignores the missing behave stubs, so local runs match the
pre-commit hook.
The unit-test and behave guidelines now prefer PyHamcrest's
assert_that()with a matcher to state the condition of an assertion. The behave steps use
equal_to()for every whole-value comparison, and pass the set differencesand the output of blackvuesync as the reason. The change also removes the
CLAUDE.mdfiles that only importedAGENTS.md.Validation:
scripts/check.shpassed, with 71.51% unit test coverage. Thebehave results are 27 passed and 1 skipped for the current protocol, and 28
passed for the legacy protocol. Docker mode gives the same results, and the
listing error scenario runs there too. The coverage runs passed. A direct run
on Python 3.9 passed. All pre-commit hooks passed. The package version
remains 2.2.0.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XhzDTTf8Wj1sNRHqJdHcUz