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

Add slow query E2E test #1141

Merged
merged 7 commits into from
Jan 17, 2022
Merged

Conversation

YiniXu9506
Copy link
Contributor

@YiniXu9506 YiniXu9506 commented Jan 14, 2022

What this PR did?

  • adds E2E test for Slow query time range picker
  • clear database by rebooting TiUP

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 14, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • shhdgit

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@YiniXu9506 YiniXu9506 changed the title Add slow query e2 e test Add slow query E2E test Jan 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2022

Codecov Report

Merging #1141 (a894693) into master (ac4ddec) will increase coverage by 1.84%.
The diff coverage is 100.00%.

❗ Current head a894693 differs from pull request most recent head abe3d40. Consider uploading reports for the commit abe3d40 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1141      +/-   ##
==========================================
+ Coverage   28.10%   29.95%   +1.84%     
==========================================
  Files         227      227              
  Lines       12908    12908              
  Branches      647      647              
==========================================
+ Hits         3628     3866     +238     
+ Misses       9130     8892     -238     
  Partials      150      150              
Flag Coverage Δ
be_integration_test_latest 6.88% <ø> (ø)
be_integration_test_v4.0.1 6.88% <ø> (ø)
be_unit_test 23.83% <ø> (ø)
e2e_test 55.38% <100.00%> (+8.46%) ⬆️

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

Impacted Files Coverage Δ
ui/dashboardApp/layout/main/Sider/index.tsx 95.45% <ø> (-2.28%) ⬇️
ui/lib/apps/SlowQuery/pages/List/index.tsx 61.76% <ø> (+47.05%) ⬆️
ui/lib/components/BaseSelect/index.tsx 68.42% <ø> (+67.10%) ⬆️
ui/lib/components/MultiSelect/index.tsx 75.00% <ø> (+65.90%) ⬆️
ui/lib/components/ErrorBar/index.tsx 72.72% <100.00%> (+27.27%) ⬆️
ui/lib/components/TimeRangeSelector/index.tsx 90.19% <100.00%> (+62.74%) ⬆️
ui/lib/components/Bar/Bar.tsx 44.44% <0.00%> (-22.23%) ⬇️
.../lib/apps/Statement/components/StatementsTable.tsx 40.00% <0.00%> (-20.00%) ⬇️
ui/lib/apps/Statement/utils/useStatements.ts 67.74% <0.00%> (-16.13%) ⬇️
ui/lib/apps/Statement/utils/tableColumns.tsx 53.33% <0.00%> (-13.34%) ⬇️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac4ddec...abe3d40. Read the comment docs.

scripts/start_tiup.sh Outdated Show resolved Hide resolved
Copy link
Member

@shhdgit shhdgit left a comment

Choose a reason for hiding this comment

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

The rest LGTM.

Comment on lines +12 to +13
"viewportWidth": 1500,
"viewportHeight": 1000
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines 23 to 24
const dashboardAuthToken = localStorage.getItem('dashboard_auth_token')
window.localStorage.setItem('dashboard_auth_token', dashboardAuthToken)
Copy link
Member

@shhdgit shhdgit Jan 17, 2022

Choose a reason for hiding this comment

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

Are localStorage and window.localStorage different in cypress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no difference between the window.localStorage and localStorage in Cypress.

@@ -0,0 +1,211 @@
// Copyright 2021 PingCAP, Inc. Licensed under Apache-2.0.
Copy link
Member

@shhdgit shhdgit Jan 17, 2022

Choose a reason for hiding this comment

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

How about organizing the code by functional modules. So that we can reduce some directory nesting and /__image_snapshots__ that generated by https://github.com/meinaart/cypress-plugin-snapshots can also be organized by functional modules.

Like:

/ui/cypress/integration/slow_query/list.spec.js
/ui/cypress/integration/slow_query/list.compat_spec.js
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will update the organization.

@breezewish breezewish merged commit ea838ed into pingcap:master Jan 17, 2022
@breezewish
Copy link
Member

breezewish commented Jan 17, 2022

Could we have some overview sights about the E2E coverage?

@YiniXu9506
Copy link
Contributor Author

YiniXu9506 commented Jan 18, 2022

Could we have some overview sights about the E2E coverage?

Yes, I've been uploaded the report to Codecov Report, you can look into the report by clicking the link at Codecov Report.

https://app.codecov.io/gh/pingcap/tidb-dashboard/compare/1141?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr%20comments&utm_term=pingcap

@YiniXu9506 YiniXu9506 deleted the addSlowQueryE2ETest branch January 18, 2022 02:32
@breezewish
Copy link
Member

Could we have some overview sights about the E2E coverage?

Yes, I've been uploaded the report to Codecov Report, you can look into the report by clicking the link at Codecov Report.

https://app.codecov.io/gh/pingcap/tidb-dashboard/compare/1141?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr%20comments&utm_term=pingcap

Cool! By the way is it possible to run this automatically? For example, by integrating with the CI run over master branch or run over the PR?

@YiniXu9506
Copy link
Contributor Author

YiniXu9506 commented Jan 18, 2022

Could we have some overview sights about the E2E coverage?

Yes, I've been uploaded the report to Codecov Report, you can look into the report by clicking the link at Codecov Report.
https://app.codecov.io/gh/pingcap/tidb-dashboard/compare/1141?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr%20comments&utm_term=pingcap

Cool! By the way is it possible to run this automatically? For example, by integrating with the CI run over master branch or run over the PR?

The uploading job Upload coverage to Codecov has been added to CI, so we can see the report on every CI run over master and PRs. When the test CI passed, the report link will show on the Codecov Report.

shhdgit pushed a commit to shhdgit/tidb-dashboard that referenced this pull request Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants