Skip to content

fix: give three tests distinct screenshot names, so a failure keeps its evidence - #290

Merged
pftg merged 1 commit into
masterfrom
fix/284-distinct-screenshot-names
Aug 25, 2026
Merged

fix: give three tests distinct screenshot names, so a failure keeps its evidence#290
pftg merged 1 commit into
masterfrom
fix/284-distinct-screenshot-names

Conversation

@pftg

@pftg pftg commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #284. Unblocks #285.

index-without-img-cropped was asserted by three tests, not the two #284 reported — :117 (color_distance_limit), :129 (crop accepts css selector), and :200 (skip_area: "input").

A differing screenshot is written to its baseline path by design. So when one fails, the next re-captures the same name, matches, and leaves the file clean — the failure's evidence is destroyed before artifacts upload.

Measured on a real failing run

Run 32740082766, artifact screenshots-selenium_headless-chunky_png-diffs. The job reported a 26.06% difference; its uploaded files and the committed baseline are one and the same:

5fccb56f4a47d41b3a8c8cdf38531da6  index-without-img-cropped.base.png   (artifact)
5fccb56f4a47d41b3a8c8cdf38531da6  index-without-img-cropped.png        (artifact)
5fccb56f4a47d41b3a8c8cdf38531da6  index-without-img-cropped.png        (committed)

Anyone opening that artifact to debug #285 finds two identical PNGs and concludes the failure was spurious.

The change

All three visit /index-without-img.html and crop "form", so they share one rendering — which is why this went unnoticed. Each renamed test gets a copy of that same baseline in all six os/driver directories. Nothing is re-recorded; no comparison changes.

The color_distance_limit test keeps the original name so its baseline history stays continuous.

On verification — read this before trusting a green

This is not verified locally and I am not claiming it is. Running this file on my machine reports:

[snap_diff] 0 verified, 0 changed, 0 new. NOTHING WAS VERIFIED

…and it reports the same on unmodified master, so a local green here would be the very bug class 2.0 exists to kill. Test Drivers is where these baselines actually compare, so this PR carries full-ci.

standardrb clean.

Summary by Sourcery

Bug Fixes:

  • Give the selector-cropping and skipped-area screenshot tests distinct names so failures retain their own diagnostic evidence.

Summary by CodeRabbit

  • Tests
    • Updated screenshot fixture names to clearly distinguish selector-based crops from existing cropped screenshots.
    • Clarified naming for screenshots that crop while skipping specified areas.

…ts evidence

`index-without-img-cropped` was asserted by THREE tests, not the two #284
reported: the `color_distance_limit` case (:117), `crop accepts css selector`
(:129), and the `skip_area: "input"` case (:200).

A differing screenshot is written to its baseline path by design, so when one of
them fails the next re-captures the same name, matches, and leaves the file
clean. The failure's own evidence is gone before artifacts upload.

Measured on the real failing run 32740082766, artifact
`screenshots-selenium_headless-chunky_png-diffs`: the job reported a **26.06%
difference** and its uploaded `.base.png`, `.png` and the committed baseline were
all `5fccb56f4a47d41b3a8c8cdf38531da6`. Anyone opening that artifact to debug the
flake finds two identical PNGs and concludes it was spurious. That is why #285
has never been diagnosed.

All three visit `/index-without-img.html` and crop `"form"`, so they share one
rendering -- which is exactly why the collision went unnoticed for so long. Each
renamed test therefore gets a copy of that same baseline in all six
os/driver directories; nothing is re-recorded and no comparison changes.

The `color_distance_limit` test keeps the original name so its baseline history
stays continuous.

NOT verified locally, and deliberately not claimed to be: this file reports
`0 verified -- NOTHING WAS VERIFIED` on this machine, and does so on unmodified
master too, so a local green here is not evidence. `Test Drivers` is where these
baselines actually compare; this PR carries `full-ci` for that reason.
@pftg pftg added the full-ci Run full test matrix on this PR label Aug 25, 2026

@sourcery-ai sourcery-ai Bot 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.

Sorry @pftg, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Prevents screenshot failure evidence from being overwritten by giving the three otherwise-identical assertions distinct baseline names, while preserving the original baseline history and duplicating the existing image across all supported driver directories. Verification is intentionally delegated to full CI because local runs verify no screenshots.

File-Level Changes

Change Details Files
Assign unique screenshot baseline names to the two tests that previously collided with the shared cropped screenshot.
  • Rename the CSS-selector crop assertion.
  • Rename the skip-area crop assertion.
  • Preserve the original name for the color-distance test to maintain baseline history.
  • Add matching copies of the renamed baselines across all six OS/driver directories without re-recording screenshots.
test/integration/browser_screenshot_test.rb
Use CI-specific verification because local execution cannot exercise the relevant screenshot comparisons.
  • Rely on full CI Test Drivers for baseline verification.
  • Keep formatting validation clean with standardrb.

Assessment against linked issues

Issue Objective Addressed Explanation
#284 Give each of the three tests that previously used "index-without-img-cropped" a distinct screenshot name to prevent failures from overwriting their evidence.
#284 Ensure the screenshot baselines remain available under the new names without changing the tests' visual comparison behavior.
#284 Confirm with a deliberately failing run that the uploaded .png and .base.png files genuinely differ. The PR explicitly states that this was not verified locally and does not provide evidence of a deliberately failed run with differing uploaded artifacts.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 740e67d4-95fa-4d2b-b044-ba2f0fc38958

📥 Commits

Reviewing files that changed from the base of the PR and between d276752 and 4307599.

⛔ Files ignored due to path filters (12)
  • test/fixtures/app/doc/screenshots/linux/cuprite/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/linux/cuprite/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/linux/selenium_chrome_headless/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/linux/selenium_chrome_headless/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/linux/selenium_headless/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/linux/selenium_headless/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/cuprite/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/cuprite/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/selenium_chrome_headless/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/selenium_chrome_headless/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/selenium_headless/index-without-img-crop-by-selector.png is excluded by !**/*.png
  • test/fixtures/app/doc/screenshots/macos/selenium_headless/index-without-img-crop-with-skip-area.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • test/integration/browser_screenshot_test.rb

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The integration tests now use distinct screenshot fixture names for selector-based cropping and combined cropping with skip-area masking.

Changes

Screenshot fixture names

Layer / File(s) Summary
Update screenshot fixture expectations
test/integration/browser_screenshot_test.rb
The selector-cropping test uses index-without-img-crop-by-selector. The combined crop and skip-area test uses index-without-img-crop-with-skip-area.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 43075

The tests now use distinct screenshot names while preserving their existing baselines, so failures can retain separate diagnostic evidence; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: assigning distinct screenshot names to three tests to preserve failure evidence.
Linked Issues check ✅ Passed The changes address issue #284 by updating the colliding screenshot names for the selector-cropping and skipped-area tests while retaining the original name for the color-distance test. The requested …
Out of Scope Changes check ✅ Passed The reported changes are limited to screenshot test names and related fixtures. They directly support the linked issue and contain no unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

The changes address issue #284 by updating the colliding screenshot names for the selector-cropping and skipped-area tests while retaining the original name for the color-distance test. The requested failure-evidence verification is a testing task and is excluded from coding compliance.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/284-distinct-screenshot-names

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pftg
pftg merged commit 7809756 into master Aug 25, 2026
48 of 58 checks passed
@pftg
pftg deleted the fix/284-distinct-screenshot-names branch August 25, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run full test matrix on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two tests share a screenshot name, so a failure overwrites its own evidence

1 participant