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

fix: front end CI tests and test runner #10897

Merged
merged 3 commits into from
Sep 16, 2020
Merged

Conversation

eschutho
Copy link
Member

@eschutho eschutho commented Sep 15, 2020

SUMMARY

Fixes a CI error 'every step must define a uses or run key' and the remaining jest tests that weren't running on CI.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Manually check that tests are running: https://github.com/apache/incubator-superset/actions/runs/256530135

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Just a small suggestion.

@@ -50,7 +50,7 @@ export default function getComponentWidthFromDrop({
let destinationCapacity =
destinationWidth.width - destinationWidth.occupiedWidth;

if (Number.isNaN(destinationCapacity)) {
if (Number.isNaN(Number(destinationCapacity))) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we move these Number coercing above to where the variables are defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks to me that you still want to return the original value as defined if it's not a number. If I coerce them earlier, you're going to get NaN as a value. I'm reading through the code now to see if that will work, but you're probably more familiar with the code than I am.

Copy link
Member

Choose a reason for hiding this comment

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

I actually know nothing about this file, lol. Just took another look, for destinationCapacity at least, it's calculated from an arithmetic operation so it's definitely expected to be a number.

Copy link
Member Author

Choose a reason for hiding this comment

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

destinationWidth.draggingWidth is the only that still returns a value even though it may not be a number.

@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2020

Codecov Report

Merging #10897 into master will increase coverage by 6.25%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10897      +/-   ##
==========================================
+ Coverage   59.59%   65.85%   +6.25%     
==========================================
  Files         780      813      +33     
  Lines       37203    38307    +1104     
  Branches     3339     3595     +256     
==========================================
+ Hits        22171    25226    +3055     
+ Misses      14845    12977    -1868     
+ Partials      187      104      -83     
Flag Coverage Δ
#cypress 56.89% <75.00%> (+0.71%) ⬆️
#javascript 61.76% <87.50%> (?)
#python 61.44% <ø> (ø)

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

Impacted Files Coverage Δ
...plore/components/controls/FilterBoxItemControl.jsx 74.07% <50.00%> (+61.11%) ⬆️
...nd/src/dashboard/util/getComponentWidthFromDrop.js 95.65% <100.00%> (+33.74%) ⬆️
.../src/explore/components/controls/BoundsControl.jsx 93.10% <100.00%> (+13.79%) ⬆️
superset-frontend/src/setup/setupPlugins.ts 22.22% <0.00%> (-77.78%) ⬇️
superset-frontend/src/views/index.tsx 25.00% <0.00%> (-75.00%) ⬇️
superset-frontend/src/SqlLab/index.tsx 25.00% <0.00%> (-75.00%) ⬇️
superset-frontend/src/views/App.tsx 32.35% <0.00%> (-67.65%) ⬇️
...rset-frontend/src/setup/setupErrorMessagesExtra.ts 50.00% <0.00%> (-50.00%) ⬇️
superset-frontend/src/setup/setupErrorMessages.ts 54.54% <0.00%> (-45.46%) ⬇️
superset-frontend/src/views/menu.tsx 60.00% <0.00%> (-40.00%) ⬇️
... and 250 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 4eeee4c...2b1f551. Read the comment docs.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Sep 15, 2020
@eschutho eschutho force-pushed the elizabeth/fix-ci branch 2 times, most recently from be90d03 to c274611 Compare September 15, 2020 23:47
Number.isNaN(destinationCapacity) ||
Number.isNaN(Number(draggingWidth))
) {
return draggingWidth;
Copy link
Member Author

@eschutho eschutho Sep 15, 2020

Choose a reason for hiding this comment

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

@ktmud does this look more readable to you? It keeps the original return value here, to play it safe.
The value is coerced multiple times this way b/c it is defined multiple times depending on the condition.

Copy link
Member

Choose a reason for hiding this comment

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

Looking good. I think the long-term solution would be to migrate this and all related files to TypeScript so we can be more confident in changes like this.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, agree.

@eschutho eschutho changed the title Fix front end CI tests and test runner fix: front end CI tests and test runner Sep 16, 2020
@eschutho
Copy link
Member Author

Thanks @ktmud. I think the test failing on Cypress may be a flaky test. I'm working on Cypress tests this week, and can fix it separately if someone feels this is ready to merge now. Otherwise, I'll take a look at the test tomorrow.

@nytai
Copy link
Member

nytai commented Sep 16, 2020

@eschutho unfortunately cypress is a required check. It seems the sqllab tabs test is particularly flaky -- it fails quite often on master builds. You can close and reopen the PR to trigger a CI run. I've rerun the cypress check 3 times now... let's see if it passes. If it doesn't pass it may be worth [temporarily] disabling it.

@eschutho
Copy link
Member Author

Thanks @nytai it looks like the checks did pass, but there have been some merges to master, so I rebased again to make sure that builds don't break on master. I'll keep checking on this.

@eschutho eschutho closed this Sep 16, 2020
@eschutho eschutho reopened this Sep 16, 2020
@eschutho eschutho closed this Sep 16, 2020
@eschutho
Copy link
Member Author

restarting checks.

@eschutho eschutho reopened this Sep 16, 2020
@nytai nytai merged commit 13cc1a3 into apache:master Sep 16, 2020
@nytai nytai deleted the elizabeth/fix-ci branch September 16, 2020 18:35
@ktmud
Copy link
Member

ktmud commented Sep 16, 2020

You can also rerun failed tests on the "Checks" page:

@nytai
Copy link
Member

nytai commented Sep 16, 2020

@ktmud I think that button is only available to committers

@ktmud
Copy link
Member

ktmud commented Sep 16, 2020

@ktmud I think that button is only available to committers

😱 🤯

auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.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/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants