You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2023/08/02 19:33:24 UTC

[GitHub] [superset] rusackas opened a new pull request, #24872: tests(cypress): Fail Cypress on Console errors

rusackas opened a new pull request, #24872:
URL: https://github.com/apache/superset/pull/24872

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   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 will probably break like crazy right now... we can disable breakage on "preexisiting conditions" in this PR, and consider that tech debt. Then we can stop the snowballing of these errors (particularly ones that sneak in with package bumps.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   I expect E2E will fail miserably... I'll add patches until it passes, I hope.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #24872:
URL: https://github.com/apache/superset/pull/24872#issuecomment-1666222322

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24872:
URL: https://github.com/apache/superset/pull/24872#issuecomment-1662868411

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24872?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#24872](https://app.codecov.io/gh/apache/superset/pull/24872?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (7cf654c) into [master](https://app.codecov.io/gh/apache/superset/commit/f7e76d02b7cbe4940946673590bb979984ace9f5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f7e76d0) will **decrease** coverage by `10.56%`.
   > Report is 1 commits behind head on master.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #24872       +/-   ##
   ===========================================
   - Coverage   69.00%   58.44%   -10.56%     
   ===========================================
     Files        1906     1906               
     Lines       74135    74135               
     Branches     8207     8207               
   ===========================================
   - Hits        51154    43330     -7824     
   - Misses      20860    28684     +7824     
     Partials     2121     2121               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `54.13% <ø> (ø)` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `54.03% <ø> (ø)` | |
   | python | `61.29% <ø> (-22.08%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `55.00% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   [see 294 files with indirect coverage changes](https://app.codecov.io/gh/apache/superset/pull/24872/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on a diff in pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #24872:
URL: https://github.com/apache/superset/pull/24872#discussion_r1290418325


##########
superset-frontend/cypress-base/cypress/support/e2e.ts:
##########
@@ -18,9 +18,32 @@
  */
 import '@cypress/code-coverage/support';
 import '@applitools/eyes-cypress/commands';
+import failOnConsoleError, { Config } from 'cypress-fail-on-console-error';
 
 require('cy-verify-downloads').addCustomCommand();
 
+// fail on console error, allow config to override individual tests
+// these exceptions are a little pile of tech debt
+const { getConfig, setConfig } = failOnConsoleError({
+  consoleMessages: [
+    /\[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: /,

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on a diff in pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #24872:
URL: https://github.com/apache/superset/pull/24872#discussion_r1290420807


##########
superset-frontend/cypress-base/cypress/support/index.d.ts:
##########
@@ -41,6 +41,7 @@ declare namespace Cypress {
     cleanDashboards(): cy;
     loadChartFixtures(): cy;
     loadDashboardFixtures(): cy;
+    setConsoleMessages(consoleMessages: (string | RegExp)[]): cy;

Review Comment:
   Agreed, done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas commented on pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #24872:
URL: https://github.com/apache/superset/pull/24872#issuecomment-1690964091

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] michael-s-molina commented on a diff in pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #24872:
URL: https://github.com/apache/superset/pull/24872#discussion_r1285030393


##########
superset-frontend/cypress-base/cypress/support/index.d.ts:
##########
@@ -41,6 +41,7 @@ declare namespace Cypress {
     cleanDashboards(): cy;
     loadChartFixtures(): cy;
     loadDashboardFixtures(): cy;
+    setConsoleMessages(consoleMessages: (string | RegExp)[]): cy;

Review Comment:
   Maybe `allowConsoleMessages` would be a better name?



##########
superset-frontend/cypress-base/cypress/support/e2e.ts:
##########
@@ -18,9 +18,32 @@
  */
 import '@cypress/code-coverage/support';
 import '@applitools/eyes-cypress/commands';
+import failOnConsoleError, { Config } from 'cypress-fail-on-console-error';
 
 require('cy-verify-downloads').addCustomCommand();
 
+// fail on console error, allow config to override individual tests
+// these exceptions are a little pile of tech debt
+const { getConfig, setConfig } = failOnConsoleError({
+  consoleMessages: [
+    /\[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: /,

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] rusackas merged pull request #24872: test(cypress): Fail Cypress on Console errors

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #24872:
URL: https://github.com/apache/superset/pull/24872


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org