-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Remove use of Properties for URL query parsing, fixes #6403 #6407
Remove use of Properties for URL query parsing, fixes #6403 #6407
Conversation
When I run the tests locally with |
The tests pass locally for me as well, but a re-run of the CI failed as
well, so it's not just a flaky test. Let me investigate...
|
Three of the Database tests fail when run in my IDE as well, so looking
into what's different among the CI, ./refine test, and IntelliJ
environments.
|
OK, I'm not sure why the test isn't failing locally (perhaps some difference in the test runner environment?), but the failure is real. I think what's needed is to update the mocks to implement Lines 171 to 178 in cdbdf36
|
The local test suite does not have all tests of the database extension enabled, because those require having a running SQL server (of different flavors). OpenRefine/.github/workflows/pull_request_server.yml Lines 99 to 110 in e6dbcfc
|
Thank you for your responses, but unfortunately, I am not sure how I should move forward with this? I have tried, but I don't know how I should replicate the failures locally so it becomes very hard for me to test. One small difference between the old URL parser and the new parser is that the old parser took the last value if the key was provided multiple times. However, @tfmorris explained in the issue that parameters could not be repeated. Therefore it shouldn't be a problem to return the first value like this |
@EliasStihl My apologies. The situation is definitely sub-optimal. The method I used to recreate the failure was to directly run the tests in DatabaseImportControllerTest using my IDE's test runner. I was using IntelliJ, but Eclipse should work as well. Without MySQL installed they won't all succeed, but they should give you enough insight to see what needs to be fixed. The problem is not with your code, but with the test itself. It mocks We apparently don't have the database test environment setup documented for developers, which I will work on now, but you should be able to get away with just MySQL. Basically, you want to:
If you get stuck, or this is too much hassle, let me know and I can fix up the PR so that we can get it merged. |
Actually, I've got an easier solution. We'll just switch that test to use SQLite instead of MySQL. It doesn't look like I can push to your branch, so I've put the fix up in a branch on my repo. If you |
d45d5ab
to
49f6ea6
Compare
Once again, thank you for the incredible support! I think all tests pass now, but please let me know if there is anything you want me to change. |
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.
Looks great! Thank you for sticking with it! I'll merge it after #6412 gets merged so I can rebase it on top. I also have a couple of test helper methods for DatabaseImportControllerTest which will remove some of the duplication.
For future reference, it makes it easier for us to review if you push incremental fixes in separate commits rather than force pushing a completely new commit. That way we can easily separate stuff that's been reviewed already from the new stuff. All the commits will get squashed when we merge the PR, so there's no need to worry about the extra commits.
Okay, sorry about that, but thanks for telling me so I know how to do it properly in the future! |
Fixes #6403
Changes proposed in this pull request:
ParsingUtilities
that returnjava.util.Properties
.static public Map<String, String> parseParameters(HttpServletRequest request)
, as a replacement forparseUrlParameters
. This new method utilizes therequest.getParameterMap()
functionality for its implementation.parseUrlParameters
to use the new method.(Map<String, String>)
.ImportingUtilities
that usejava.util.Properties
and make new versions of them usingMap<String, String>
instead.