<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div style="-webkit-text-size-adjust: auto; ">A few examples just done in 5 minutes, not extensive...</div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; "><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><a href="https://github.com/openstack/nova/blob/master/nova/tests/test_objectstore.py">https://github.com/openstack/nova/blob/master/nova/tests/test_objectstore.py</a></span></div><div><font face=".HelveticaNeueUI"><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">- that starts up an s3 server, huh?<br></span></font><br><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><a href="https://github.com/openstack/nova/blob/master/nova/tests/test_cinder.py">https://github.com/openstack/nova/blob/master/nova/tests/test_cinder.py</a></span></div><div><font face=".HelveticaNeueUI"><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">- nova is making sure that the cinder client works, huh?</span></font></div><div><font face=".HelveticaNeueUI"><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);"><br></span></font></div><div><font face=".HelveticaNeueUI"><span style="font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">It seems to be getting better in grizzly now that we have all these client libraries to act as the intermediary, so that's progress, just it don't know why it took until grizzly to do this....</span></font></div><div><br><span style="-webkit-text-size-adjust: auto;">Sent from my really tiny device...</span></div><div style="-webkit-text-size-adjust: auto; "><br>On Feb 10, 2013, at 10:47 AM, "Joshua Harlow" <<a href="mailto:harlowja@yahoo-inc.com">harlowja@yahoo-inc.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto; "><div><span>100% agree, there is a mix-mash of unit tests and things called unit tests</span><br><span>(more likely integration tests) in the code bases. In anvil I often actually</span><br><span>have to remove certain tests from running since said test depends on some</span><br><span>other component "strongly" (swift tests in nova if I remember</span><br><span>correctly).</span><br><span></span><br><span>Sort of sad that it requires a whole complex system of setup</span><br><span>this before that, just to run unit tests...</span><br><span></span><br><span>Sent from my really tiny</span><br><span>device...</span><br><span></span><br><span>On Feb 9, 2013, at 11:25 AM, "John Griffith"</span><br><span><<a href="mailto:john.griffith@solidfire.com">john.griffith@solidfire.com</a>> wrote:</span><br><span></span><br><blockquote type="cite"><span>Hey Everyone,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I just wanted to</span><br></blockquote><span>get some thoughts going around our unit testing process. The good thing is</span><br><span>we seem to do a pretty good job of requiring unit tests with patches, the</span><br><span>bad thing is I'm not sure I think our strategy on how we implement those</span><br><span>unit tests is the best. There are a couple of things I've been noticing</span><br><span>lately that is somewhat annoying for me.</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>First, I guess I have my own</span><br></blockquote><span>view of what a Unit test is and maybe that's not in line with the rest of</span><br><span>the community. My opinion is that a unit test should be the smallest white</span><br><span>box test possible on a piece of code, and the boundary of a unit test should</span><br><span>be the class the code that's being exercised belongs/lives in. This means</span><br><span>that for things like db calls, calls out to other modules etc that fakes, or</span><br><span>mocks should be used to provide the inputs and responses needed by the code</span><br><span>under test. This of course requires a bit more discipline around</span><br><span>consistency in our public interfaces which IMO we desperately need as</span><br><span>well.</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>We seem to be going down a path of requiring more and more</span><br></blockquote><span>infrastructure and reliance from modules inside of the respective projects</span><br><span>code base, and lately (the most annoying thing to me) is actually requiring</span><br><span>the installation of the project and it's services in order for our unit</span><br><span>tests to run. This seems wrong to me. I also think that we're getting some</span><br><span>great benefit from a lot of hard work that's been going on around our unit</span><br><span>test framework and infrastructure, but it seems that we keep making it</span><br><span>increasingly complex and difficult to run and most of all use our unit tests</span><br><span>for debugging purposes. It seems like we've really moved more towards</span><br><span>integration tests rather than unit tests IMO. Yes; I can use venv (prefer</span><br><span>not to), Yes; I can use devstack (and I do for integration and functional</span><br><span>tests), but I don't think that unit tests should be so heavy in terms of</span><br><span>services, and inter-project dependencies.</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I think that unit tests</span><br></blockquote><span>should be easy to run, with only as much complexity as is minimally required</span><br><span>in order to test your segment of code. I think that unit tests should be</span><br><span>*unit* tests, not integration tests, not inter-module dependency tests,</span><br><span>installer tests etc. Those sorts of things should be handled in</span><br><span>devstack/gate tests and in Tempest. </span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Anyway, I don't want to go on a</span><br></blockquote><span>rant or anything here. I just wanted to throw some opinions out there and</span><br><span>see if I'm in the minority or if any others have similar thoughts around</span><br><span>this.</span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thanks,</span><br></blockquote><blockquote type="cite"><span>John</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span>_______________________________________________</span><br><blockquote type="cite"><span>OpenStack-dev mailing</span><br></blockquote><span>list</span><br><blockquote type="cite"><span><a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></span><br><span></span><br><span></span><br></div></blockquote></body></html>