-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
modify travis tests to create user with password for mysql and postgres #1092
modify travis tests to create user with password for mysql and postgres #1092
Conversation
…es and use these in the SQLALCHEMY_DATABASE_URI
@dennisobrien please do experiments on your own fork instead of here |
…e 'sqlalchemy_uri' field and the encrypted password in the 'password' field. Modified 'testconn' to work with this. If the passed uri is different from the masked uri, use the passed uri. Otherwise, use the decrypted uri associated with this database.
The original intent was to test SQLALCHEMY_DATABASE_URI with a username and password as a test for #1070 (sorry @xrmx -- I only realized after that I could have run the same tests Travis runs on my own machine). The follow up commits address #1070
|
@dennisobrien If you are going to poke with testconn please cherry-pick whatever seems sensible (the test at least) from this pull request: Also my logic in views seems a bit easier to follow i think. |
Thanks @xrmx -- I wasn't aware of that test. I brought in the test but I didn't use git cherry-pick since I needed just part of the commit. I still don't have tests running properly on my dev machine so I'm committing the changes with the hopes that the tests will pass. Do you recommend that this PR supercedes #694 or that I merge that branch into this one and deal with the merge conflicts? |
@dennisobrien no need to do that, i am going to close #694 if all the relevant pieces are included there :) |
response = self.client.post('/caravel/testconn', data=data, content_type='application/json') | ||
assert response.status_code == 200 | ||
|
||
database = ( |
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.
have you checked this return something with a password?
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.
This test has three parts, but now that I think of it, it should really just use the last two since some of the test cases are against a sqlite db and others use mysql or postgres. So I think I should remove the hard-coded uri here and just rely on the other two tests. One of those two tests with the password masked, the other with the password included in the uri.
This leaves two tests: one that uses the password-masked uri, and the other that uses the uri with the password included.
.query(models.Database) | ||
.filter_by(database_name=database_name) | ||
.first() | ||
) | ||
request_uri = request.json.get('uri') |
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.
uri = request.json.get('uri')
so that you can save a couple of assigments later?
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.
I did some refactoring here just as you posted this comment. I could skip creating request_uri
but I thought I'd be explicit.
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.
I simplified the forking paths here in 8c91119
Thanks for the advice!
Hmm, I'm getting a new test failure that has me scratching my head. This passed in the previous Travis run so I'm not sure what's happening here.
|
The remaining questions I have:
|
Il 17/09/2016 02:16, dennisobrien ha scritto:
I've upgraded my test caravel instance to a recent master and it broke |
#694 was merged into master. I'm dealing with the merge conflicts in this branch and will push something shortly. |
* Single quote filter values with comma * refactor for codeclimate limite * Added unit tests and tooltip
* [sql lab] specify schema name when generating vanila query * Fixing some react warnings
* Add time grain support for time columnd in unix timestamp * Fix datetime parsing for unix epoch Since we've already converted unix epoch to datetime type, we shouldn't specify 'unit' parameter in pandas.to_datetime * Fix SQLite timestamp to datetime conversion
…e#1120) margin_size does not apply. Also nvd3 auto-adjust font-size of axis labels. Temporary solution here: Setting a fixed font-size on nvd3 axis labels and a minimum threshold for label size.
* When the label size is too short, the constant for calculating margin_size does not apply. Also nvd3 auto-adjust font-size of axis labels. Temporary solution here: Setting a fixed font-size on nvd3 axis labels and a minimum threshold for label size. * Only stretch margin for dist_bar
* [explore] giving more room to Slice title * h2->h3 for slice title
* [security] prevent XSS on FAB list views * addressing comments
If ddtm_expr is an expression with special characters then timestamp_grain escapes the special characters already escaped. Solution discussed with sqlalchemy upstream: https://bitbucket.org/zzzeek/sqlalchemy/issues/3737/literal_column-given-a-specific-sql Fix apache#617
…e 'sqlalchemy_uri' field and the encrypted password in the 'password' field. Modified 'testconn' to work with this. If the passed uri is different from the masked uri, use the passed uri. Otherwise, use the decrypted uri associated with this database.
…e 'sqlalchemy_uri' field and the encrypted password in the 'password' field. Modified 'testconn' to work with this. If the passed uri is different from the masked uri, use the passed uri. Otherwise, use the decrypted uri associated with this database.
I've found myself in an endless loop of git rebase in order to try to deal with these branch conflicts but I'm afraid I'm making a bigger mess. If it is simpler to close this PR and have me open another I'm happy to do that. |
@dennisobrien do whatever you feel more comfortable with :) |
Closing this PR and starting a clean PR. |
Modify the Travis CI tests to create a database user with a password and use these in the SQLALCHEMY_DATABASE_URI for the tests for mysql and postgres.
This is related to #1070 and I expect this PR to have failing Travis tests.
It's fine to reject this PR -- I just wanted to verify that the tests will fail.