Unit tests for SCM clients in RBTools

22 views
Skip to first unread message

Griffin Myers

unread,
Feb 5, 2015, 11:26:29 PM2/5/15
to reviewb...@googlegroups.com
I'd like to try and gain a better understanding of how unit tests are chosen for SCM clients in RBTools and what types of additional unit tests might be welcomed.

My motivation here is that I have aspirations for developing patches for several SVN related bugs that I have opened in recent months (3641, 3649, and 3674).  My intuition is that when fixing these bugs I should also provide unit tests so as to attempt to prevent the issues from possibly being reintroduced in the future.  In looking at rbtools/clients/tests.py it's not clear to me that many, if any, of the existing tests were added in response to prior bugs (caveat: I only skimmed over the tests from other SCMs and focused on SVN which doesn't have a very extensive test set).  At a minimum a search didn't reveal any comments pointing to existing bug reports.

Also, the content in the testdata repo for SVN is very limited with only one file under revision control and three total revisions.  Are there any guidelines for when the contents of this repo may be modified if necessary for supporting new unit tests?

To experiment with nose and the existing unit tests for the SVN client, I put together a simple new unit test focused on #3749, which was my bug report related to the now reverted change that caused SVN diffs to be relative to the checkout root.  The unit test ensures that diffs generated from the root, a subdirectory, or via an explicit include are all identical.  I'd be happy to post this for review if there is any value in it.

Thanks,
Griffin

Christian Hammond

unread,
Feb 5, 2015, 11:30:28 PM2/5/15
to reviewb...@googlegroups.com, Griffin Myers
Hi Griffin,

Much of the RBTools code base dates back to darker times when RBTools was just one big script bundled in a contrib/ directory in the Review Board source tree. Over time, much work was done to split that up and to start developing better separations between the pieces of the codebase.

It's only relatively recently that it became possible to really test much of the SCMClients code, which is why there are so few tests. Certainly, we should be beefing up this test suite more as we go.

The testdata repo can be modified any time it's necessary to add more data for tests.

I'd love to take any patches you might have that improve the test suite.

Christian

--
Christian Hammond - chri...@beanbaginc.com
Review Board - https://www.reviewboard.org
Beanbag, Inc. - https://www.beanbaginc.com
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "reviewboard-dev"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard-d...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Griffin Myers

unread,
Feb 7, 2015, 11:44:08 AM2/7/15
to reviewb...@googlegroups.com, griffin...@gmail.com, chri...@beanbaginc.com
Hi Christian,

Thanks for the info, it will be helpful going forward.

I've posted the unit test I mentioned to https://reviews.reviewboard.org/r/6916/

Griffin
Reply all
Reply to author
Forward
0 new messages