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: Configured babel plugin for removing data-test from production code #11327

Merged

Conversation

adam-stasiak
Copy link
Contributor

@adam-stasiak adam-stasiak commented Oct 19, 2020

SUMMARY

I added babel plugin for production debug babel variant - it trims data-test from production code. It requires passing BABEL_ENV=production while building prod.
I observed that it is not applicable for inputProps:

                        <Datetime
                          inputProps={{ 'data-test': 'date-from-input' }}

and for code in templates in superset/ directory:

<!-- Modal for misc messages / alerts  -->
    <div class="misc-modal modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content" data-test="modal-content">
          <div class="modal-header" data-test="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close" data-test="modal-header-close-button">

It is working for

      <tr {...{ 'data-test': 'table-row' }} className="row" key={record.id}>
        {tds}
      </tr>,

So I think the next step is to wrap somehow elements from superset/ and replace inputProps with some other wrapper for elements.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before:
image

after:
image

TEST PLAN

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

@adam-stasiak
Copy link
Contributor Author

retry because of fail in not related test

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11327      +/-   ##
==========================================
- Coverage   65.66%   62.95%   -2.72%     
==========================================
  Files         835      444     -391     
  Lines       39656    14987   -24669     
  Branches     3604     3686      +82     
==========================================
- Hits        26042     9435   -16607     
+ Misses      13505     5371    -8134     
- Partials      109      181      +72     
Flag Coverage Δ
#cypress ?
#javascript 62.95% <ø> (+0.27%) ⬆️
#python ?

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

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupColors.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/chart/ChartContainer.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupFormatters.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/reducers/index.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupPluginsExtra.js 0.00% <0.00%> (-100.00%) ⬇️
... and 593 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 735123d...dc279aa. Read the comment docs.

@willbarrett willbarrett requested review from rusackas and nytai October 26, 2020 23:02
@willbarrett
Copy link
Member

This looks reasonable to me, but would love an opinion from @nytai or @rusackas

Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

LGTM. I still think there's a case for having data-test attrs in prod, but we can add them back if that time ever comes.

@mistercrunch mistercrunch merged commit df15a6f into apache:master Oct 27, 2020
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 🚢 1.0.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/S 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants