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

test(cypress): Fail Cypress on Console errors #24872

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Aug 2, 2023

SUMMARY

A lot of console errors have been creeping into the repo, and failing silently. These really only get noticed by random devs/users now when clicking around.

This PR won't systemically resolve these, but it will fail whey Cypress randomly encounter them during E2E tests.

This PR now swallows all console errors that would otherwise fail CI with this plugin installed. This is a new pile of tech debt. Now that we have disables failure on "preexisiting conditions" in this PR, we can stop the addition of further error types (particularly ones that sneak in with package bumps.

The rest of these should be addressed in subsequent PRs, to systemically get rid of these errors, or at least fine-tune the overrides from this PR to be more specific (in individual files/tests, etc).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

E2E now passes, and you can see all the errors this swallows to do so.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@rusackas rusackas changed the title tests(cypress): Fail Cypress on Console errors test(cypress): Fail Cypress on Console errors Aug 2, 2023
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #24872 (7e6db69) into master (f7e76d0) will decrease coverage by 0.01%.
Report is 49 commits behind head on master.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #24872      +/-   ##
==========================================
- Coverage   69.00%   68.99%   -0.01%     
==========================================
  Files        1906     1906              
  Lines       74135    74135              
  Branches     8207     8207              
==========================================
- Hits        51154    51151       -3     
- Misses      20860    20863       +3     
  Partials     2121     2121              
Flag Coverage Δ
hive 54.13% <ø> (ø)
javascript 55.82% <ø> (-0.01%) ⬇️
mysql 79.22% <ø> (ø)
postgres 79.32% <ø> (ø)
presto 54.03% <ø> (ø)
python 83.37% <ø> (ø)
sqlite 77.89% <ø> (ø)
unit 55.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pull-request-size pull-request-size bot added size/S and removed size/XS labels Aug 3, 2023
@rusackas
Copy link
Member Author

rusackas commented Aug 4, 2023

This adds the plugin to block all console errors, and then adds configuration to let them slide. In follow-up PRs, we can start disabling these configs, one by one, and whittle away at the pile.

CC @michael-s-molina for a review, since I think this is where we discussed letting the initial PR sit, and open the door to actual cleanup.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you @rusackas! This will really help improve the quality of our codebase.

superset-frontend/cypress-base/cypress/support/index.d.ts Outdated Show resolved Hide resolved
/\[webpack-dev-server\]/,
'The pseudo class ":first-child" is potentially unsafe when doing server-side rendering. Try changing it to ":first-of-type".',
'The pseudo class ":nth-child" is potentially unsafe when doing server-side rendering. Try changing it to ":nth-of-type".',
/Warning: /,
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to make this regex more restrictive and add specific warning types? My concern is that any new warning will be ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes... that was going to be my next PR. Just trying to get the framework through. I can add it here, though.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for working on this @rusackas!

@rusackas
Copy link
Member Author

@jinghua-qa @geido @eschutho @betodealmeida can I get a codeowner review on this? Hoping to merge it and then start backing out the exceptions one by one in subsequent PRs.

@rusackas rusackas merged commit 63f24ea into master Aug 24, 2023
51 checks passed
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
@mistercrunch mistercrunch deleted the fail-cypress-on-console-errors branch March 26, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants