-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
refactor(test): add login_as_admin to global conftest #20703
Conversation
c0164e1
to
8aa2f77
Compare
Codecov Report
@@ Coverage Diff @@
## master #20703 +/- ##
==========================================
- Coverage 66.83% 66.67% -0.17%
==========================================
Files 1750 1750
Lines 65894 65896 +2
Branches 7017 7017
==========================================
- Hits 44041 43936 -105
- Misses 20067 20174 +107
Partials 1786 1786
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f35101e
to
cbcd013
Compare
@@ -1979,6 +1979,8 @@ def dashboard( | |||
return self.render_template( | |||
"superset/spa.html", | |||
entry="spa", | |||
# dashboard title is always visible | |||
title=dashboard.dashboard_title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case test_get_dashboard
actually tests dashboard title in the HTML, but the spa doesn't output it anymore. I'm not sure why current master
passes the CI. It throws a test error, too, when running locally on my machine.
5c09d99
to
d0dad7b
Compare
6760188
to
9b82814
Compare
chart["table"]["table_name"] or "", | ||
] | ||
).lower() | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bycatch: asserting for entity counts is probably not a good idea---as the test database can be populated with different data for various reasons. We should test against the actual underlying function itself----which, in this case, is filtering by a couple of text fields.
I caught this because my refactoring failed to clean up charts added in the import/export tests, which has now been fixed.
9b82814
to
a1ded4f
Compare
a1ded4f
to
b20260e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice refactor!
SUMMARY
test_client
andlogin_as
seems to be two very commonly used utilities for integration tests. Let's move it to global conftest.Only did this for function-based test suites. Class based test suites should probably be refactor to function-based later.
No visible changes to users.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION