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

chore: Cypress runtime enhancements #21332

Merged
merged 34 commits into from
Sep 12, 2022
Merged

Conversation

geido
Copy link
Member

@geido geido commented Sep 5, 2022

SUMMARY

This PR is part of a tech debt initiative. It proposes several enhancements to the Cypress suite and runtime improvements, as follows:

This PR enhances the dashboard, dashboard list, chart list, dataset, alerts_and_reports and database suites.

  • It reduces the time of execution of about 10 minutes
  • It reduces to the minimum the number of page reloads
  • Introduces a new pattern to create sample charts and dashboards on the fly via fixtures
  • It introduces certain Cypress best standards, such as preferring data-test and provides utils such as getBySel
  • It creates several util functions that can be used across the entire suite or for specific areas
  • It adds the _skip prefix to those files that had all their tests skipped so that it is easier to spot them
  • It reorganizes the directory structure and places tests that fall under the same category within the same test files
  • It increases test coverage for the dashboards and charts lists

WHAT'S NEXT

  • All the _skip files should be fixed and their tests enhanced following the new patterns
  • All the tests that are skipped within any file should be fixed or removed
  • Implement the same patterns for the remaining tests, such as directories explore, sqllab
  • Should we remove the support/directories file? I disagree that's a good way to keep Cypress organized

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N.A.

TESTING INSTRUCTIONS

All tests should pass and quicker

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

@codecov
Copy link

codecov bot commented Sep 5, 2022

Codecov Report

Merging #21332 (1318e88) into master (3197cc6) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #21332      +/-   ##
==========================================
- Coverage   66.52%   66.50%   -0.02%     
==========================================
  Files        1791     1791              
  Lines       68593    68593              
  Branches     7319     7319              
==========================================
- Hits        45630    45619      -11     
- Misses      21072    21083      +11     
  Partials     1891     1891              
Flag Coverage Δ
hive 52.94% <ø> (ø)
javascript 52.73% <0.00%> (ø)
mysql ?
postgres 80.82% <ø> (+0.01%) ⬆️
presto 52.84% <ø> (ø)
python 81.20% <ø> (-0.04%) ⬇️
unit 50.80% <ø> (ø)

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

Impacted Files Coverage Δ
...frontend/src/components/Chart/DrillDetailModal.tsx 100.00% <ø> (ø)
...end/src/components/PageHeaderWithActions/index.tsx 90.00% <ø> (ø)
...ashboard/components/BuilderComponentPane/index.tsx 76.47% <ø> (ø)
...frontend/src/dashboard/components/Header/index.jsx 60.29% <ø> (ø)
...src/dashboard/components/PropertiesModal/index.tsx 61.81% <ø> (ø)
...dashboard/components/SliceHeaderControls/index.tsx 70.21% <ø> (ø)
...tersConfigModal/FiltersConfigForm/DefaultValue.tsx 9.09% <0.00%> (ø)
superset/common/utils/dataframe_utils.py 90.47% <0.00%> (-4.77%) ⬇️
superset/db_engine_specs/mysql.py 94.04% <0.00%> (-4.77%) ⬇️
superset/models/core.py 88.34% <0.00%> (-0.70%) ⬇️
... and 6 more

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

@geido geido marked this pull request as ready for review September 7, 2022 15:15
cy.get('[data-test="sort-header"]').eq(7).contains('Modified');
// TODO: this assert is flaky, we need to find a way to make it work consistenly
// cy.get('[data-test="sort-header"]').eq(7).contains('Active');
// cy.get('[data-test="sort-header"]').eq(8).contains('Actions');
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you fixed the Active one. Is Actions a lost cause, or should we leave the commented line in for now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I think I just forgot to keep that comment. Cypress won't recognize that one. There is something weird going on with it. For now, I'll bring the comment back.

Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

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

LGTM!

@geido geido merged commit 8539d4c into master Sep 12, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the chore/cypress-runtime-enhancements branch March 26, 2024 16:08
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/XXL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants