-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
migrate namefiltertest to Junit 5 #3938
migrate namefiltertest to Junit 5 #3938
Conversation
This pull request does too many different things. The number one rule of pull requests is to do one thing (see the contributing guidelines. This rule sometimes gets complicated when it's hard to do interdependent things separately, but your modifications here are completely orthogonal: extraction of part of a test class into a separate test class, migration to JUnit5 of said part, and addition of a test case. Each of these can stand on their own. The reason it's so important to keep PRs focused on one thing is that it makes it much easier to review them. A rule of thumb: if you can't summarize all of the changes of a PR with the title, then it's not focused. Also, I don't see any edits to the original test class from which you extracted the test case. Perhaps you forgot this? Could you please do the following?
As a side note, don't take this as a scolding or anything of the sort, I'm just trying to help you to write more concise PRs :) |
Hi @slarse,
Thanks for sharing this rule.
Yes, I should have removed the NameFilterTest from filterTest.
Yes, I feel that I should first migrate some test classes to Junit5 before doing anything else, but I feel that it might be better If I start with a smaller test file, and after that migrate filterTest to Junit5.
I feel that nameFilterTest isn't at the correct place currently, it should be in spoon/legacy instead of being in spoon/test/filters/testclasses
I will keep this in mind.
Not at all, that's the whole idea of students contributing to real world projects, so that they can learn the best practises, I am glad that I am getting detailed review on PR. I have a question, to which branch I should be pushing my commits? |
I will close this PR after 1 day (following the 1 day rule for closing PRs), and will raise an atomic PR (will migrate only one testclass to Junit5 in it). |
It might, but I don't think you'll have any trouble migrating
You are right that the test is not strictly in the correct place, and I'm not opposed to the idea of moving it. Edit: Actually, #3677 is about 50:50 about the messy test organization and test resources! So we should reach a consensus there before we start moving tests.
Good! I just wanted to mention this to set the tone. You'll probably get more than a few reviews from me, and they can seem harsh if you're not mentally prepared.
The 1 day rule is for integrators: They must wait at least 1 day before merging a new PR to allow other integrators the time to also have a look. Contributors can close their PRs at any time they wish. |
I will also try to do it automatically thanks for letting me know this.
Yes, we should quickly reach a consensus, the further we delay, the more work will be left behind.
I believe to learn something, and to change old habits one needs to step out of his comfort zone, no worries :P |
Hi @slarse, @monperrus & @nharrand Thanks for helping me merge my last PR, as #3946 is merged now, I was wondering what will be the best thing to do after that. As the structure of the tests & tests resource is yet to be finalised, so I believe I should wait before extracting the nameFilterTest into a separate file. Should I next try to improve the line coverage from 55% to 100% ? But as the test Strength and mutation coverage of nameFilterTest is already 100%, should we prioritize other classes or it will be worth improving the line coverage? or should I migrate other tests to Junit5 (this time more complex tests involving more manual changes)? |
I'm not familiar enough with GSOC to give any advice on this in that respect, so I'll defer that question to @monperrus and @nharrand. If you're just looking to do some "practice contributions" (which seems like a good way to get started regardless of the particular goals of your GSOC project), I'd say you can do pretty much anything. The important thing would be the process of performing PRs, which requires some amount of practice. As you are to improve the test suite, I would personally very much appreciate if you convert the test classes you intend to work on to JUnit5 before you start improving them, as the more JUnit4 tests we add, the harder migration will be. So perhaps just migrate a few test classes to begin with? |
Hi @slarse, Thanks for your suggestions.
I haven't yet decided on which classes I will be working on.
This seems a good start to me : ) I have one question, do I need to push one PR at a time, and wait for it to get merged to raise another? or I can raise more than one PR at a time from different branches? |
You can have several PRs open at any one time (one of the benefits of opening PRs from separate branches). Just try to avoid opening PRs that conflict with each other, that is to say, edit the same parts of the same files. There's no risk of that when migrating test classes from JUnit4 to JUnit5, though, as you just operate on one file at a time. |
Hi team,
In this commit I have:
Statistics of nameFilter class.
I guess in the next commit the objective could be to improve the line coverage from 66% to 100% ?