-
Notifications
You must be signed in to change notification settings - Fork 770
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] Refactoring integration tests #270
Conversation
This is really nice work. Must have been pretty tedious, so thanks! That said, it's going to be a right pain to rebase onto! :) Ah well - all in the name of progress! I only have a couple of vague comments. Otherwise LGTM. Reviewed 184 of 184 files at r1. ycmd/tests/cs/diagnostics_test.py, line 119 [r1] (raw file): ycmd/tests/python/utils.py, line 23 [r1] (raw file): maybe also for They are pretty much the same in each implementation (the only difference is the runtime value of Comments from the review on Reviewable.io |
I have just a little comment :)
Yeah :( It would be the second time for me 😝 (the subcommand map refactoring) but
👍 Reviewed 145 of 184 files at r1. Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/typescript/utils.py, line 29 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 14 of 184 files at r1. ycmd/tests/clang/diagnostics_test.py, line 76 [r1] (raw file): Comments from the review on Reviewable.io |
Update
If you are wondering about the leading underscore in the method names of the Review status: 89 of 111 files reviewed at latest revision, 4 unresolved discussions. ycmd/tests/clang/diagnostics_test.py, line 76 [r1] (raw file): ycmd/tests/cs/diagnostics_test.py, line 119 [r1] (raw file): ycmd/tests/python/python_handlers_test.py, line 23 [r1] (raw file): ycmd/tests/typescript/typescript_handlers_test.py, line 29 [r1] (raw file): Comments from the review on Reviewable.io |
Review status: 89 of 111 files reviewed at latest revision, 2 unresolved discussions. ycmd/tests/clang/diagnostics_test.py, line 76 [r1] (raw file): Comments from the review on Reviewable.io |
I've been meaning to do this for more than a year, but I knew it would be so tedious I couldn't bring myself to do it. You're a better man than I! Thank you so much for doing this.
Yay! :) Could you also use @puremourning's coverage setup to verify the number is the same (or higher) after these changes? Just as a sanity check. Review status: 89 of 111 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/test_utils.py, line 4 [r3] (raw file): Comments from the review on Reviewable.io |
I added coverage to my repository and there is a very small decrease that I don't understand. I get the exact same coverage results on Travis for the two commits: without the refactoring and with. Is this a coveralls.io bug? Review status: 89 of 111 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/test_utils.py, line 4 [r3] (raw file): Comments from the review on Reviewable.io |
Maybe. For such a small decrease, I wouldn't worry about it. Review status: 89 of 111 files reviewed at latest revision, 3 unresolved discussions. Comments from the review on Reviewable.io |
I found the issue. The tests folder was not ignored by coveralls.io. By ignoring it, I obtain about the same coverage (there is still a difference but it is so small that we can ignore it). Since we already merged PR #271, I'll send a PR to ignore the tests and also the Remaining things to do (maybe for another PR?):
Review status: 89 of 111 files reviewed at latest revision, 3 unresolved discussions. Comments from the review on Reviewable.io |
For the second item, i think the limiting factor in the existing tests is the creation of the TestApp, which you're already abstracting, so I hope it should be a matter of only creating that once-per-script rather than once-per-test, using class-level fixtures. From nose docs:
Reviewed 10 of 27 files at r2, 3 of 4 files at r3. ycmd/tests/clang/diagnostics_test.py, line 76 [r1] (raw file): ycmd/tests/handlers_test.py, line 43 [r3] (raw file): Comments from the review on Reviewable.io |
Wouldn't we open us to issues where we run tests in a non clean environment? Review status: 100 of 111 files reviewed at latest revision, 3 unresolved discussions. Comments from the review on Reviewable.io |
Review status: 100 of 111 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/handlers_test.py, line 43 [r3] (raw file): Comments from the review on Reviewable.io |
Reviewed 12 of 27 files at r2, 1 of 1 files at r4. ycmd/tests/handlers_test.py, line 43 [r3] (raw file): Comments from the review on Reviewable.io |
Regarding the C# test performance, I implemented a persistence instance of Omnisharp to improve this in my fork a while ago, though I never got around to making a pull request for it. I don't know how useful it is now, but you're welcome to use it if you want. Comments from the review on Reviewable.io |
Thanks. I'll take a look. Review status: all files reviewed at latest revision, 3 unresolved discussions. Comments from the review on Reviewable.io |
d9ecb84
to
a859173
Compare
@micbou Both of the "remaining work" points you've mentioned sound like they should be separate PRs. This one is nice and focused so let's keep it that way. Review status: all files reviewed at latest revision, 3 unresolved discussions. Comments from the review on Reviewable.io |
☔ The latest upstream changes (presumably #272) made this pull request unmergeable. Please resolve the merge conflicts. |
a859173
to
fda5434
Compare
@puremourning I'm currently moving the Javascript completer tests to the new class structure but I'm encountering an issue with the
Did you already get this kind of error? I can't find what is causing this. I'm correctly changing the current directory at the start of the test and the arguments passed to the Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
I can repo with your branch. I will take a look. Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
@micbou I think you lost my change to Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
Yes, that's it. Thanks! Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from the review on Reviewable.io |
Yo dawg. I heard you liked PRs, so I made a PR on your PR. So you can merge when you merge. Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from the review on Reviewable.io |
Ok, I'll merge it but only because it's you! Review status: 110 of 116 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from the review on Reviewable.io |
Fix failing javascript test
Reviewed 1 of 6 files at r6. ycmd/tests/javascript/event_notification_test.py, line 54 [r6] (raw file): in any case, removing @with_cwd means that contextlib2 is no longer a test requirement (i think) Comments from the review on Reviewable.io |
Review status: 110 of 116 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/javascript/event_notification_test.py, line 54 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: 110 of 116 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/javascript/event_notification_test.py, line 54 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: 110 of 116 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/javascript/event_notification_test.py, line 54 [r6] (raw file): Comments from the review on Reviewable.io |
Review status: 110 of 116 files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/javascript/javascript_handlers_test.py, line 51 [r6] (raw file): Comments from the review on Reviewable.io |
Reviewed 5 of 6 files at r6. Comments from the review on Reviewable.io |
Reviewed 1 of 3 files at r8. Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r7, 2 of 3 files at r8. Comments from the review on Reviewable.io |
One remaining thing I would like to do is move the Tern server starting and stopping to the corresponding setUp and the tearDown methods. Review status: all files reviewed at latest revision, 3 unresolved discussions. ycmd/tests/javascript/javascript_handlers_test.py, line 51 [r6] (raw file): Comments from the review on Reviewable.io |
Move Tern server starting and stopping in tests to the corresponding setUp and tearDown methods in Javascript_Handlers_test
I think this is ready. Things to do in other PRs:
Review status: 113 of 117 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
Nice! Thanks for doing this! @homu r+ Review status: 113 of 117 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
📌 Commit 2e75b9c has been approved by |
⚡ Test exempted - status |
[READY] Refactoring integration tests ### Changes - Move related completer tests to their own subdirectories: ``` ycmd └── tests ├── clang │ ├── testdata │ ├── __init__.py │ ├── get_completions_test.py │ ├── diagnostics_test.py │ ├── subcommands_test.py │ └── utils.py ├── cs ── ... ├── python ── ... ├── go ── ... ... ``` - Regroup tests in classes and subclasses: take advantage of fixtures (`setUp` and `tearDown` methods) and inheritance. - Rename tests: names are now shorter; - Fix coding style; - Update copyright notices; - No tests were harmed during the making of this PR: 458 tests before, 458 tests after. ### Issues? - Code to set the Bottle debug mode: ```python import bottle bottle.debug( True ) ``` was removed from all tests inheriting from `Handlers_test` where it is set in the `setUp` method. Is it enough to enable debug mode in all tests? I don't know how to check this. - `Basic_test` and `ZeroBasedLineAndColumn_test` tests in `Cs_Diagnostics_test` are near to be identical. Should we remove one of them? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/270) <!-- Reviewable:end -->
Changes
setUp
andtearDown
methods) and inheritance.Issues?
was removed from all tests inheriting from
Handlers_test
where it is set in thesetUp
method. Is it enough to enable debug mode in all tests? I don't know how to check this.Basic_test
andZeroBasedLineAndColumn_test
tests inCs_Diagnostics_test
are near to be identical. Should we remove one of them?