Skip to content

[WIP] test: Update the tolerance to match other 3d comparisons#6084

Open
wayfarer3130 wants to merge 1 commit into
masterfrom
test/annotation-fixes
Open

[WIP] test: Update the tolerance to match other 3d comparisons#6084
wayfarer3130 wants to merge 1 commit into
masterfrom
test/annotation-fixes

Conversation

@wayfarer3130

@wayfarer3130 wayfarer3130 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Context

Changes & Results

Testing

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] OS:
  • [] Node version:
  • [] Browser:

Summary by CodeRabbit

  • Tests
    • Updated screenshot assertion tests with improved tolerance for visual variations to account for GPU and driver-related differences.

Greptile Summary

This PR updates the screenshot comparison in tests/3DPrimary.spec.ts to use the object-based checkForScreenshot API and raises the pixel-diff tolerance from the default 2% to 4%, matching the approach already used by the 3DOnly sibling test to account for GPU/driver noise in 3D ray-cast output.

  • Migrates the call site from the old positional signature (page, locator, screenshotPath) to the CheckForScreenshotProps object form, which is consistent with 3DOnly.spec.ts.
  • Sets maxDiffPixelRatio: 0.04 to reduce flakiness caused by per-run variation in volumetric rendering without widening tolerance beyond what the existing 3D tests already accept.

Confidence Score: 5/5

This is a one-line test-file change that adjusts a screenshot tolerance; it has no effect on production code.

The change correctly uses the object-based checkForScreenshot overload supported by the existing utility, and the chosen maxDiffPixelRatio of 0.04 is exactly the value already in use for the nearly identical 3DOnly test. No logic, types, or imports are affected beyond this single call site.

No files require special attention.

Important Files Changed

Filename Overview
tests/3DPrimary.spec.ts Switches checkForScreenshot call from the positional API to the object-based API and sets maxDiffPixelRatio: 0.04 to match the sibling 3DOnly test's tolerance

Reviews (1): Last reviewed commit: "Update the tolerance to match other 3d c..." | Re-trigger Greptile

@netlify

netlify Bot commented Jun 16, 2026

Copy link
Copy Markdown

Deploy Preview for ohif-dev failed. Why did it fail? →

Name Link
🔨 Latest commit 964aff9
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6a319963a15aab000873f83d

@coderabbitai

coderabbitai Bot commented Jun 16, 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: 38c8119a-eb44-4146-ab75-7dff874d0295

📥 Commits

Reviewing files that changed from the base of the PR and between 780d172 and 964aff9.

📒 Files selected for processing (1)
  • tests/3DPrimary.spec.ts

📝 Walkthrough

Walkthrough

The checkForScreenshot call in tests/3DPrimary.spec.ts is converted from positional arguments to an options object, and a maxDiffPixelRatio: 0.04 tolerance field is added. The target locator and screenshot path remain unchanged.

Changes

3D Primary screenshot assertion

Layer / File(s) Summary
checkForScreenshot options object with maxDiffPixelRatio
tests/3DPrimary.spec.ts
Converts the positional checkForScreenshot call to an object-based style and adds maxDiffPixelRatio: 0.04 tolerance; locator and screenshot path are unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hopped past the GPU's glow,
Where pixels drift with a shader's show.
"Four percent," it said with a flop of its ear,
"Is wiggle room enough, have no fear!"
🐇✨ The screenshots pass — now off I go!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is specific and relates to the main change (updating tolerance for 3D tests), but the [WIP] prefix indicates work-in-progress status and should be removed before merge. Remove the [WIP] prefix from the title so it reads: 'test: Update the tolerance to match other 3d comparisons'
Description check ⚠️ Warning The PR description is incomplete with all required sections left empty (Context, Changes & Results, Testing) and all checklist items unmarked. Complete all sections: add context explaining why tolerance was changed, describe the specific changes made, explain testing approach, and mark all applicable checklist items.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 test/annotation-fixes

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 and usage tips.

@cypress

cypress Bot commented Jun 16, 2026

Copy link
Copy Markdown

Viewers    Run #6379

Run Properties:  status check passed Passed #6379  •  git commit 964aff90cd: Update the tolerance to match other 3d comparisons
Project Viewers
Branch Review test/annotation-fixes
Run status status check passed Passed #6379
Run duration 01m 41s
Commit git commit 964aff90cd: Update the tolerance to match other 3d comparisons
Committer Bill Wallace
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 28
View all changes introduced in this branch ↗︎

Comment thread tests/3DPrimary.spec.ts
locator: viewportPageObject.grid,
// Volume-3D ray-cast output is GPU/driver-noisy run-to-run; match the
// tolerance already used by the sibling 3DOnly test.
maxDiffPixelRatio: 0.04,

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.

@wayfarer3130 I have incorporated this into PR #6067

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.

2 participants