Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bandaid: skip e2e modal screenshots until fix #4825

Closed
wants to merge 1 commit into from

Conversation

sashankaryal
Copy link
Contributor

@sashankaryal sashankaryal commented Sep 19, 2024

There's a known issue of screenshot comparison being off by 1 pixel: See microsoft/playwright#20015

Summary by CodeRabbit

  • Bug Fixes
    • Temporarily disabled screenshot validation tests across various components due to a known issue with pixel discrepancies.
    • Added a skipped test for modal media field functionality to prevent test failures while addressing the screenshot comparison issue.

These changes allow the testing suite to continue functioning without interruptions while the visual fidelity issues are being resolved.

@sashankaryal sashankaryal self-assigned this Sep 19, 2024
Copy link
Contributor

coderabbitai bot commented Sep 19, 2024

Walkthrough

The changes in the pull request involve commenting out various screenshot validation assertions across multiple test files related to a 3D rendering application. This action addresses a known issue where the screenshot comparisons are "off by one pixel," which has caused test failures. The modifications serve as a temporary workaround to allow the test suites to run without interruption while highlighting the need for future fixes to the screenshot comparison logic.

Changes

Files Change Summary
e2e-pw/src/oss/specs/3d/fo3d-pcd-stl.spec.ts Commented out assertions for modal container screenshots due to a known pixel discrepancy.
e2e-pw/src/oss/specs/3d/pcd-only-dataset.spec.ts Commented out screenshot validation tests for orthographic projections due to the same pixel issue.
e2e-pw/src/oss/specs/groups/ima-vid.spec.ts Commented out assertions for modal screenshots at specific frames due to the pixel discrepancy.
e2e-pw/src/oss/specs/regression-tests/group-video/group-video-label.spec.ts Commented out assertions for modal screenshots before and after video playback due to the pixel issue.
e2e-pw/src/oss/specs/regression-tests/media-field.spec.ts Added a skipped test case for modal screenshot comparison due to the pixel discrepancy.
e2e-pw/src/oss/specs/smoke-tests/tagger.spec.ts Commented out assertion for modal screenshot comparison due to an off-by-one-pixel issue.

Possibly related PRs

  • fix tagger e2e tests #4783: This PR modifies the tagger.spec.ts test suite, focusing on improving the reliability of end-to-end tests for the tagger functionality.
  • skip e2e tests that use zoo datasets #4804: This PR affects the tagger.spec.ts file by skipping tests reliant on a problematic dataset, aligning with the management of test assertions related to visual discrepancies.

🐇 In the meadow where pixels play,
A rabbit hops and sings today.
"Oh, the tests that once did fail,
Are now on hold, we’ll prevail!
With hopes to fix the pixel plight,
We'll bounce back, all will be right!" 🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sashankaryal sashankaryal force-pushed the bandaid/e2e-modal-screenshots-skip branch from d75b6ed to 99c79ba Compare September 19, 2024 21:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cf84356 and 99c79ba.

Files selected for processing (6)
  • e2e-pw/src/oss/specs/3d/fo3d-pcd-stl.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/3d/pcd-only-dataset.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/groups/ima-vid.spec.ts (2 hunks)
  • e2e-pw/src/oss/specs/regression-tests/group-video/group-video-label.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/regression-tests/media-field.spec.ts (1 hunks)
  • e2e-pw/src/oss/specs/smoke-tests/tagger.spec.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • e2e-pw/src/oss/specs/3d/pcd-only-dataset.spec.ts
Additional context used
Path-based instructions (5)
e2e-pw/src/oss/specs/3d/fo3d-pcd-stl.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/groups/ima-vid.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/regression-tests/group-video/group-video-label.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/regression-tests/media-field.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

e2e-pw/src/oss/specs/smoke-tests/tagger.spec.ts (1)

Pattern **/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Additional comments not posted (5)
e2e-pw/src/oss/specs/3d/fo3d-pcd-stl.spec.ts (4)

111-115: Temporary workaround: Address the TODO comment in the future.

Commenting out the screenshot assertion is a temporary workaround to allow the test suite to run without interruption. However, it means that the visual correctness of the rendered scene is not being validated.

Please ensure that the TODO comment is addressed in the future to fix the screenshot comparison logic and re-enable the assertion.


123-130: Temporary workaround: Address the TODO comment in the future.

Commenting out the screenshot assertion is a temporary workaround to allow the test suite to run without interruption. However, it means that the visual correctness of the rendered scene with minimum line widths is not being validated.

Please ensure that the TODO comment is addressed in the future to fix the screenshot comparison logic and re-enable the assertion.


134-141: Temporary workaround: Address the TODO comment in the future.

Commenting out the screenshot assertion is a temporary workaround to allow the test suite to run without interruption. However, it means that the visual correctness of the rendered scene with maximum line widths is not being validated.

Please ensure that the TODO comment is addressed in the future to fix the screenshot comparison logic and re-enable the assertion.


146-150: Temporary workaround: Address the TODO comment in the future.

Commenting out the screenshot assertion is a temporary workaround to allow the test suite to run without interruption. However, it means that the visual correctness of the rendered scene for the next sample is not being validated.

Please ensure that the TODO comment is addressed in the future to fix the screenshot comparison logic and re-enable the assertion.

e2e-pw/src/oss/specs/groups/ima-vid.spec.ts (1)

152-156: Temporary workaround: Commented out another screenshot verification assertion.

Similar to the previous code segment, commenting out this screenshot verification assertion is a temporary workaround for the known issue where the modal screenshot comparison is off by one pixel. This allows the test to pass for now.

Please refer to the previous review comment about creating a GitHub issue to track the fix for the underlying screenshot comparison issue. Once the issue is fixed, both of these assertions should be re-enabled.

Comment on lines +78 to +81
test.skip(
null,
"TODO: FIX ME. MODAL SCREENSHOT COMPARISON IS OFF BY ONE-PIXEL"
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Skipped test case needs to be addressed in the future.

Skipping the test case temporarily unblocks the test suite, but it's important to fix the underlying issue with the modal screenshot comparison. The skipped test case should be re-enabled once the root cause is resolved to ensure the correctness of the functionality.

Consider creating a GitHub issue to track the resolution of the skipped test case. This will help ensure that the issue is not forgotten and is addressed in a timely manner.

Do you want me to open a GitHub issue to track this task?

Comment on lines +128 to +129
// TODO: FIX ME. MODAL SCREENSHOT COMPARISON IS OFF BY ONE-PIXEL
// await expect(modal.looker).toHaveScreenshot("labels.png");
Copy link
Contributor

Choose a reason for hiding this comment

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

Temporary workaround: Disabled screenshot comparison

Commenting out the screenshot comparison assertion is a temporary measure to allow the test suite to run without interruption. However, it's crucial to investigate and resolve the underlying pixel mismatch issue to restore the visual validation of the modal component.

Please create a separate issue to track the resolution of the off-by-one-pixel discrepancy in the screenshot comparison logic. This will ensure that the problem is properly addressed and the visual fidelity of the modal is maintained in the long run.

Comment on lines +102 to +106
// TODO: FIX ME. MODAL SCREENSHOT COMPARISON IS OFF BY ONE-PIXEL
// check screenshot before video is played
await expect(modal.looker).toHaveScreenshot(`${slice}-before-play.png`, {
animations: "allow",
});
// await expect(modal.looker).toHaveScreenshot(`${slice}-before-play.png`, {
// animations: "allow",
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

Temporary workaround: Disabled modal screenshot comparison

The code segment is commented out as a temporary workaround for the known issue where the modal screenshot comparison is off by one pixel. While this allows the test suite to run without interruption, it's important to prioritize fixing the underlying issue to enable proper visual validation.

In the meantime, consider focusing the test on verifying that the correct label is displayed rather than the exact visual fidelity of the screenshots.

Comment on lines +111 to +118
// TODO: FIX ME. MODAL SCREENSHOT COMPARISON IS OFF BY ONE-PIXEL
// check screenshot after video is played
await expect(modal.looker).toHaveScreenshot(`${slice}-after-play.png`, {
// masking time / frame because it might be off by a couple of seconds and we want to avoid flakiness
// the real test is that the correct label is shown
mask: [modal.video.time],
animations: "allow",
});
// await expect(modal.looker).toHaveScreenshot(`${slice}-after-play.png`, {
// // masking time / frame because it might be off by a couple of seconds and we want to avoid flakiness
// // the real test is that the correct label is shown
// mask: [modal.video.time],
// animations: "allow",
// });
Copy link
Contributor

Choose a reason for hiding this comment

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

Temporary workaround: Disabled modal screenshot comparison

Similar to the previous code segment, this assertion is commented out as a temporary workaround for the known issue where the modal screenshot comparison is off by one pixel. While this allows the test suite to run without interruption, it's important to prioritize fixing the underlying issue to enable proper visual validation.

In the meantime, consider focusing the test on verifying that the correct label is displayed rather than the exact visual fidelity of the screenshots.

Good practice: Masking time/frame to avoid flakiness

The practice of masking the time/frame to avoid flakiness in the test is a good one. This ensures that the test focuses on the essential aspects of the functionality rather than being sensitive to minor timing variations.

@sashankaryal
Copy link
Contributor Author

Subsumed by #4808

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.

1 participant