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

Fix#20125: Correct Flake (Error Using Google Docs Viewer with Puppeteer) in Logged-In User Acceptance Tests. #20210

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

rahat2134
Copy link
Contributor

@rahat2134 rahat2134 commented Apr 24, 2024

Overview

  1. This PR fixes or fixes part of [Flake]: Logged-in User should open Volunteer Url with Volunteer button in Get Involved menu on navbar #20125
  2. This PR does the following: There was an error in console occuring.
    When using Puppeteer to preview documents via Google Docs Viewer in Node.js, the browser throws an error. Despite the URL working well in a browser environment, attempting to access it through Puppeteer results in an error.
    Set that error to ignore because it was from external factors and breaking the tests.

Essential Checklist

Please follow the instructions for making a code change.

  • I have linked the issue that this PR fixes in the "Development" section of the sidebar.
  • I have checked the "Files Changed" tab and confirmed that the changes are what I want to make.
  • I have written tests for my code.
  • The PR title starts with "Fix #bugnum: " or "Fix part of #bugnum: ...", followed by a short, clear summary of the changes.
  • I have assigned the correct reviewers to this PR (or will leave a comment with the phrase "@{{reviewer_username}} PTAL" if I can't assign them directly).

Proof that changes are correct

Screenshot 2024-04-24 at 11 06 57 PM

PR Pointers

@rahat2134 rahat2134 requested a review from a team as a code owner April 24, 2024 17:37
Copy link

oppiabot bot commented Apr 24, 2024

Assigning @StephenYu2018 for the first pass review of this PR. Thanks!

@rahat2134 rahat2134 requested a review from seanlip April 24, 2024 17:37
@rahat2134 rahat2134 changed the title Fix#20125: Flake in logged in user. Fix#20125: Fix flake in logged in user. Apr 24, 2024
@rahat2134 rahat2134 assigned seanlip and unassigned StephenYu2018 Apr 24, 2024
* URL, then these errors can arise. So, we ignore these errors.
* Using regex because each time the exploration ID will be different.
*/
// After deleting the exploration if we want to access the exploration with the
Copy link
Member

Choose a reason for hiding this comment

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

Add a comma after "exploration".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


const DEFAULT_SPEC_TIMEOUT_MSECS = testConstants.DEFAULT_SPEC_TIMEOUT_MSECS;

// Exclude the error related to Google Docs Viewer since it's from an external service
// and cannot be controlled.
Copy link
Member

Choose a reason for hiding this comment

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

controlled --> controlled by us

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


const DEFAULT_SPEC_TIMEOUT_MSECS = testConstants.DEFAULT_SPEC_TIMEOUT_MSECS;

// Exclude the error related to Google Docs Viewer since it's from an external service
// and cannot be controlled.
// https://stackoverflow.com/questions/50909239/how-to-use-google-docs-viewer-with-puppeteer
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@seanlip seanlip assigned rahat2134 and unassigned seanlip Apr 24, 2024
@rahat2134 rahat2134 assigned seanlip and unassigned rahat2134 Apr 24, 2024
@rahat2134 rahat2134 requested a review from seanlip April 24, 2024 17:49
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@seanlip
Copy link
Member

seanlip commented Apr 24, 2024

@rahat2134 Please update the title of the PR to mention the name of the flake (synopsis of error message) and that it occurs in the "logged-in user acceptance tests". The current title is quite unclear. Thanks.

@seanlip seanlip assigned rahat2134 and unassigned seanlip Apr 24, 2024
@seanlip seanlip enabled auto-merge April 24, 2024 19:09
Copy link

oppiabot bot commented Apr 24, 2024

Assigning @StephenYu2018 for code owner reviews. Thanks!

@seanlip seanlip added this pull request to the merge queue Apr 24, 2024
Merged via the queue into oppia:develop with commit a00facb Apr 24, 2024
80 checks passed
@rahat2134 rahat2134 changed the title Fix#20125: Fix flake in logged in user. Fix#20125: Correct Flake ( 'Error Message Synopsis') in Logged-In User Acceptance Tests. Apr 25, 2024
@rahat2134 rahat2134 deleted the logged-in-user-flake branch April 25, 2024 05:37
@seanlip
Copy link
Member

seanlip commented Apr 25, 2024

@rahat2134 "error message synopsis" means a summary of the error message, not the literal text "error message synopsis".

@rahat2134 rahat2134 changed the title Fix#20125: Correct Flake ( 'Error Message Synopsis') in Logged-In User Acceptance Tests. Fix#20125: Correct Flake (Error Using Google Docs Viewer with Puppeteer) in Logged-In User Acceptance Tests. Apr 25, 2024
@jnvtnguyen
Copy link
Contributor

@seanlip @rahat2134 FYI just wanted to note since I got notified on my repository that a google api key was detected, should use a regex here instead of the raw key since it can change. WDYT?

@seanlip
Copy link
Member

seanlip commented Apr 25, 2024

Oh, I didn't realize the key can change ... I think a regex is a good idea, thanks @jnvtnguyen!

(I'm also kind of confused where this key is being generated from, tbh, since AFAIK no one is logged in during this test.)

@rahat2134 can you make the change please?

@jnvtnguyen
Copy link
Contributor

Oh maybe it doesn't change since all of the keys are the same in the occurences but generally things like API keys should not be explicitly set in code IG.

@rahat2134
Copy link
Contributor Author

rahat2134 commented Apr 25, 2024

I initially considered using regex, but then I noticed that the error was consistent each time.
Sure I will update it.
@jnvtnguyen thanks for noticing.

@rahat2134 rahat2134 restored the logged-in-user-flake branch April 25, 2024 17:00
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.

4 participants