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
[READY] Add checks to ycm_core library when starting ycmd #467
Conversation
This is a pretty fantastic change! I'm not a fan of us parsing import error messages, but I don't see a better way of doing it so we'll live. @abingham @ptrv @mawww @Qusic Note that this is a breaking change to clients because it deletes @micbou This PR should probably change the README as well to document this. Shouldn't be much beyond the comment you have in the code transplanted into a new section in the README. Review status: 0 of 6 files reviewed at latest revision, 2 unresolved discussions. ycmd/server_utils.py, line 40 [r2] (raw file): In general, I try to avoid emitting error messages that don't indicate a clear way towards solving the problem. "You need to compile it" may be clear to me and you, but the more direct we are, the fewer issue reports we'll get. ycmd/tests/server_utils_test.py, line 66 [r2] (raw file): I think we used a different idiom for asserting calls on mocks in other tests, no? Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 3 unresolved discussions. ycmd/server_utils.py, line 71 [r2] (raw file): Comments from Reviewable |
I added a section to the README and I assigned a specific exit code for the "unexpected error" case instead of using the general exit code Reviewed 5 of 6 files at r1, 1 of 1 files at r2, 2 of 3 files at r4, 2 of 2 files at r5, 1 of 1 files at r6. ycmd/server_utils.py, line 40 [r2] (raw file): ycmd/server_utils.py, line 71 [r2] (raw file): ycmd/tests/server_utils_test.py, line 66 [r2] (raw file): Comments from Reviewable |
Reviewed 4 of 6 files at r1, 2 of 2 files at r5, 1 of 1 files at r6. ycmd/server_utils.py, line 71 [r2] (raw file): Comments from Reviewable |
Reviewed 1 of 1 files at r7. ycmd/server_utils.py, line 71 [r2] (raw file): Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks broke. ycmd/server_utils.py, line 51 [r7] (raw file): Comments from Reviewable |
Reviewed 4 of 6 files at r1, 1 of 2 files at r5, 1 of 1 files at r6, 1 of 1 files at r7. ycmd/tests/server_utils_test.py, line 73 [r7] (raw file): Comments from Reviewable |
d596d8c
to
267a365
Compare
Reviewed 1 of 1 files at r8. ycmd/server_utils.py, line 51 [r7] (raw file): ycmd/tests/server_utils_test.py, line 73 [r7] (raw file): Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. ycmd/tests/server_utils_test.py, line 73 [r7] (raw file): Comments from Reviewable |
In addition to the outdated library check, add the following checks: - missing library; - compiled with Python 2 but imported with Python 3; - compiled with Python 3 but imported with Python 2. Exit with a non-zero status code if one of these requirements is not met. Add corresponding tests. Remove check_core_version script.
I made some changes to the tests (they are now more robust and more readable). I am marking the PR as ready. Tell me if there is something that should be improved before we merge this. Reviewed 1 of 1 files at r9. ycmd/tests/server_utils_test.py, line 73 [r7] (raw file): Comments from Reviewable |
I continue to be satisfied with this. :) Reviewed 1 of 1 files at r8. Comments from Reviewable |
Reviewed 1 of 1 files at r8. ycmd/tests/server_utils_test.py, line 73 [r7] (raw file): ycmd/tests/server_utils_test.py, line 150 [r9] (raw file): Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions. ycmd/tests/server_utils_test.py, line 150 [r9] (raw file): Comments from Reviewable |
Then I believe that this is ready to go. @homu r=Valloric Reviewed 1 of 1 files at r9. Comments from Reviewable |
📌 Commit 85d5f6b has been approved by |
⚡ Test exempted - status |
[READY] Add checks to ycm_core library when starting ycmd Do the following checks on the ycm_core library when starting ycmd: - missing library; - compiled with Python 2 but imported with Python 3; - compiled with Python 3 but imported with Python 2; - outdated library. When one of these errors is encountered, exit with a non-zero status code specific to the error. These status codes will be used in the YCM client to display an appropriate error message to the user. In addition, starting a separate process to check the core version will not be needed anymore. This should slighty improve the Vim startup time. See issue ycm-core/YouCompleteMe#2085. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/467) <!-- Reviewable:end -->
[READY] Add error messages when ycmd crashed See PR ycm-core/ycmd#467. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2142) <!-- Reviewable:end -->
Do the following checks on the ycm_core library when starting ycmd:
When one of these errors is encountered, exit with a non-zero status code specific to the error. These status codes will be used in the YCM client to display an appropriate error message to the user. In addition, starting a separate process to check the core version will not be needed anymore. This should slighty improve the Vim startup time. See issue ycm-core/YouCompleteMe#2085.
This change is