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

build: enable typescript for cypress #10170

Merged
merged 2 commits into from Jun 29, 2020
Merged

build: enable typescript for cypress #10170

merged 2 commits into from Jun 29, 2020

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Jun 26, 2020

SUMMARY

Follow up #10161 :

  • Enable TypeScript for Cypress
  • Convert support files to TS
  • Convert an example test (dashboard/filter.test.js) to TS
  • Reenable Prefer TS check for cypress-base

Currently cypress-base is now using a newer version of TypeScript than superset-frontend. Will file another PR to upgrade later.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

All Cypress tests should still be valid and pass.

cc @etr2460

@ktmud ktmud requested a review from etr2460 June 26, 2020 07:39
@@ -72,7 +85,7 @@ describe('Dashboard filter', () => {

cy.get('.Select__control input[type=text]')
.first()
.focus({ force: true })
Copy link
Member Author

Choose a reason for hiding this comment

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

Type check helped by notifying me this is not a valid API for focus.

filterId =
dashboard.slices.find(
slice => slice.form_data.viz_type === 'filter_box',
)?.slice_id || 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

Fallback to 0 is easier than running assertions on a potential undefined.

@ktmud ktmud force-pushed the cypress-ts branch 2 times, most recently from 227baec to 35d524d Compare June 26, 2020 08:34
@etr2460
Copy link
Member

etr2460 commented Jun 26, 2020

Looks like CI is still breaking a bit, will review once fixed (i think you're missing installing an import)

@ktmud ktmud marked this pull request as draft June 26, 2020 16:40
@ktmud ktmud force-pushed the cypress-ts branch 2 times, most recently from a7f0708 to 3ce4fb0 Compare June 26, 2020 17:13
@codecov-commenter
Copy link

Codecov Report

Merging #10170 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10170      +/-   ##
==========================================
- Coverage   70.55%   70.39%   -0.16%     
==========================================
  Files         594      190     -404     
  Lines       31464    18356   -13108     
  Branches     3226        0    -3226     
==========================================
- Hits        22198    12922    -9276     
+ Misses       9150     5434    -3716     
+ Partials      116        0     -116     
Flag Coverage Δ
#cypress ?
#javascript ?
#python 70.39% <ø> (+0.03%) ⬆️
Impacted Files Coverage Δ
superset/sql_parse.py 99.30% <0.00%> (-0.01%) ⬇️
superset/errors.py 100.00% <0.00%> (ø)
superset/viz_sip38.py 0.00% <0.00%> (ø)
superset/views/database/api.py 87.50% <0.00%> (ø)
superset/views/database/mixins.py 80.70% <0.00%> (ø)
superset-frontend/src/components/Pagination.tsx
superset-frontend/src/CRUD/utils.js
...shboard/util/charts/getFormDataWithExtraFilters.ts
superset-frontend/src/components/RefreshLabel.jsx
...s/ErrorMessage/getErrorMessageComponentRegistry.ts
... and 400 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 d8314ee...3ce4fb0. Read the comment docs.

@ktmud ktmud marked this pull request as ready for review June 26, 2020 17:52
"plugin:cypress/recommended"
],
"rules": {
"import/no-unresolved": 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

Some Cypress modules might not be available if you run eslint in the parent folder before npm install in cypress-base (which is what our CI does).

@ktmud
Copy link
Member Author

ktmud commented Jun 26, 2020

@etr2460 Fixed the tests and this is now ready for re-review.

Follow up apache#10161 :

- Enable TypeScript for Cypress
- Convert support files to TS
- Convert an example test (dashboard/filter.test.js) to TS
- Upgrade TypeScript for both `cypress-base` and `superset-frontend`
- Reenable Prefer TS check for `cypress-base`
Some modules might not be available when `eslint` in the parent folder
before running `npm install` in the cypress folder.
Copy link
Member

@etr2460 etr2460 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 taking the time to do this!

@ktmud ktmud merged commit 4342c33 into apache:master Jun 29, 2020
@ktmud ktmud deleted the cypress-ts branch June 29, 2020 17:53
ktmud added a commit to ktmud/superset that referenced this pull request Sep 18, 2020
@ktmud ktmud mentioned this pull request Sep 18, 2020
6 tasks
ktmud added a commit that referenced this pull request Sep 18, 2020
Prefer TypeScript has stopped working since #10170 because of a [typo](https://github.com/apache/incubator-superset/pull/10170/files#diff-0f1a9bbd1316e385c51f8aba1583bd99R24) in `jq` script.

Also fix the `trilom/file-changes-action` GH Action version so the process can be more predictable.
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
Prefer TypeScript has stopped working since apache#10170 because of a [typo](https://github.com/apache/incubator-superset/pull/10170/files#diff-0f1a9bbd1316e385c51f8aba1583bd99R24) in `jq` script.

Also fix the `trilom/file-changes-action` GH Action version so the process can be more predictable.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Mar 12, 2024
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/L 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants