> -----Original Message----- > From: David Nalley [mailto:da...@gnsa.us] > Sent: Friday, November 09, 2012 10:34 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: Unit tests > > On Fri, Nov 9, 2012 at 2:30 PM, Alex Huang <alex.hu...@citrix.com> wrote: > > +1 the more tests the merrier. > > > > I have noticed that in master doing mvn install actually runs some unit > tests. I don't like that because it slows down compilation. I haven't track > down exactly what it is but I think it's in the nicira plugin. > > > > IMO (which isn't worth very much) running unit tests at compile is a good > thing. It puts unit tests failures front and center to anyone working on the > code and gets back to that idea of everyone being responsible for code > quality. If a unit test is failing we have no business doing anything else > until > that is fixed. Currently these tests are only adding a few seconds to compile > time in my limited tests. Additionally, if folks get into the habit of not > running the tests on every compile they will never run the tests, and a > failure will only come to light when jenkins runs the tests post-commit. > > If you really must not run the tests, you can always run -DskipTests=true
+1 I agree with David that tests should be run on every compile. Of course this depends a lot on the quality and speed of the tests, currently the tests take to long since we have some database related tests in here that slow down the unit tests. Ideally the tests should just be a few seconds (with is nothing compared to the awsapi compile) and will tell you immediately if one of the changes you are compiling into the code did actually break one of the existing unittests. This would improve the quality of the code that gets committed. (Provided we have a decent coverage) Maven has a notion of both unittests and integration tests. Though the definition of a unittest varies, the general consensus is that they should not required outside resources and generally be fast enough to run frequently. The integration tests are designed to see if multiple components actually are able to work together. Inherently slower and not run at compile time, but for example right before committing. Hugo > > --David