oppia / oppia

A free, online learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
5.63k stars 3.78k forks source link

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

Closed rahat2134 closed 2 weeks ago

rahat2134 commented 2 weeks ago

Overview

  1. This PR fixes or fixes part of #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.

Proof that changes are correct

Screenshot 2024-04-24 at 11 06 57 PM

PR Pointers

oppiabot[bot] commented 2 weeks ago

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

seanlip commented 2 weeks ago

@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.

oppiabot[bot] commented 2 weeks ago

Assigning @StephenYu2018 for code owner reviews. Thanks!

seanlip commented 2 weeks ago

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

jnvtnguyen commented 2 weeks ago

@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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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.