Skip to content

fix(tests): make screenshot expectations platform-aware#8183

Merged
singlerider merged 1 commit into
zeroclaw-labs:masterfrom
EyrieCommander:codex/issue-7462-windows-screenshot
Jun 23, 2026
Merged

fix(tests): make screenshot expectations platform-aware#8183
singlerider merged 1 commit into
zeroclaw-labs:masterfrom
EyrieCommander:codex/issue-7462-windows-screenshot

Conversation

@Audacity88

Copy link
Copy Markdown
Collaborator

Summary

Validation Evidence (required)

  • Commands run and tail output:
cargo fmt -p zeroclaw-tools -- --check
result: passed

cargo test -p zeroclaw-tools screenshot --lib
running 7 tests
test screenshot::tests::screenshot_command_exists ... ok
test screenshot::tests::screenshot_command_contains_output_path ... ok
test screenshot::tests::screenshot_tool_name ... ok
test screenshot::tests::screenshot_tool_description ... ok
test screenshot::tests::screenshot_tool_spec ... ok
test screenshot::tests::screenshot_tool_schema ... ok
test screenshot::tests::screenshot_rejects_shell_injection_filename ... ok
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 1330 filtered out

cargo clippy -p zeroclaw-tools --lib -- -D warnings
result: passed

git diff --check
result: passed
  • Beyond CI — what did you manually verify? Confirmed the diff is limited to crates/zeroclaw-tools/src/screenshot.rs and that the new unsupported-platform expectation matches the existing screenshot_command implementation.
  • If any command was intentionally skipped, why: Workspace-wide clippy and nextest were not run locally for this test-only XS slice; the focused zeroclaw-tools test and clippy coverage exercise the touched module.

Security & Privacy Impact (required)

  • New permissions, capabilities, or file system access scope? No
  • New external network calls? No
  • Secrets / tokens / credentials handling changed? No
  • PII, real identities, or personal data in diff, tests, fixtures, or docs? No
  • If any Yes, describe the risk and mitigation: N/A

Compatibility (required)

  • Backward compatible? Yes
  • Config / env / CLI surface changed? No
  • If No or Yes to either: N/A

Rollback (required for risk: medium and risk: high)

  • Fast rollback command/path: git revert <merge-sha>
  • Feature flags or config toggles: None.
  • Observable failure symptoms: Screenshot-focused unit tests fail on unsupported platforms, especially Windows, while runtime screenshot behavior remains unchanged.

Supersede Attribution (required only when Supersedes # is used)

  • Superseded PRs + authors (#<pr> by @<author>, one per line): N/A
  • Scope materially carried forward: N/A
  • Co-authored-by trailers added in commit messages for incorporated contributors? No
  • If No, why (inspiration-only, no direct code/design carry-over): No superseded PR or contributor-authored code is carried forward.

@Audacity88 Audacity88 added bug Something isn't working size: XS Auto size: <=80 non-doc changed lines. risk: high Auto risk: security/runtime/gateway/tools/workflows. tool Auto scope: src/tools/** changed. tool:browser Auto module: tool/browser changed. labels Jun 22, 2026
@Audacity88 Audacity88 marked this pull request as ready for review June 22, 2026 19:11
@Audacity88 Audacity88 requested a review from singlerider June 22, 2026 19:17

@singlerider singlerider left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked the test gating against the screenshot_command implementation.

🟢 What looks good: the cfg gates mirror the production branches exactly

screenshot_command returns Some only for target_os = "macos" and target_os = "linux", and None otherwise. The existing test now carries #[cfg(any(target_os = "macos", target_os = "linux"))] and the new test carries the exact negation, asserting None. The test coverage tracks the real platform branches with no gap and no overlap, so the suite stays meaningful on Windows and other targets instead of failing on an assumption that only holds on two platforms.

Test-only change, CI green, no outstanding reviews.

@singlerider singlerider merged commit 8fe3765 into zeroclaw-labs:master Jun 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working risk: high Auto risk: security/runtime/gateway/tools/workflows. size: XS Auto size: <=80 non-doc changed lines. tool:browser Auto module: tool/browser changed. tool Auto scope: src/tools/** changed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants