Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B7E5D0BF for ; Fri, 9 Nov 2012 19:56:56 +0000 (UTC) Received: (qmail 62445 invoked by uid 500); 9 Nov 2012 19:56:55 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 62410 invoked by uid 500); 9 Nov 2012 19:56:55 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 62402 invoked by uid 99); 9 Nov 2012 19:56:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 19:56:55 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.149.73] (HELO na3sys009aog104.obsmtp.com) (74.125.149.73) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Nov 2012 19:56:48 +0000 Received: from mail-gg0-f197.google.com ([209.85.161.197]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKUJ1f6GT8EZxSCmQqF63I98l6uEahceJo@postini.com; Fri, 09 Nov 2012 11:56:27 PST Received: by mail-gg0-f197.google.com with SMTP id y3so7109821ggc.0 for ; Fri, 09 Nov 2012 11:56:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=OHGswQQw6eDfMYCr1IwRbAJEy+1Xw+mfk1ZHTU7iGj8=; b=TUTXtCJBEMei2Q6ToFF4jS/IgPB2hKdoXRUN/Hrw7CdnH0pZE64cZ4khGnbDy/hjrm TA6DxDwba/KSfOUKlbVCeiYCai0yPkGvvd9BeRjvFU+kaY2hifPcpd/KU9NuCxy8KSlI daBzT6gPL1akTiTmNVTSpqFhRlmAANY3AGyFNrAtdll1JoKOXwoMZdk5LvCxIVYTr3VR TevjTO9JA3/jqz8SQjKbJdLEJPzUV+X/T/Akx0wvjIwxk1ZrvhqNoTH85R4C2sO3+Tez dgcivaoquPImkbJNAJBSIqPXIvgqZ9WEtCX+yVK237DzyzWK5UtgZc8OCugKWOMJQYsf 7hcw== Received: by 10.220.150.10 with SMTP id w10mr11464306vcv.16.1352490983552; Fri, 09 Nov 2012 11:56:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.150.10 with SMTP id w10mr11464300vcv.16.1352490983482; Fri, 09 Nov 2012 11:56:23 -0800 (PST) Received: by 10.58.239.135 with HTTP; Fri, 9 Nov 2012 11:56:23 -0800 (PST) In-Reply-To: References: <6DE00C9FDF08A34683DF71786C70EBF02F3811A1@SBPOMB402.sbp.lan> Date: Fri, 9 Nov 2012 14:56:23 -0500 Message-ID: Subject: Re: Unit tests From: Chip Childers To: cloudstack-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlGRCtApCYVqsCv2tcasfmvtJXg4Qu3HsqiZygZN4D3LM9x075zIYkHQbPGiPTIurYYh5hwokwZrsNUx7B9AlXw/lOFH41to9QZMkBkWxGUqlheenWnYv9217sBskNJ8qfhxQmPTKG0evt0YPeEmbBD73ntVFFkSrme8Y/JU7rEHrg/dDI+/b/uuaq55qbIQlViyJ6j X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Nov 9, 2012 at 2:46 PM, Alex Huang wrote: >> >> 1 - Do we want tests to run each time mvn install is run? > > No. I like to have choices. > >> >> 2 - Do we want to get stricter about what exactly is considered to be >> a unit test (vs an automated test that may or may not be based on the >> junit framework)? > > I actually consider db tests to be unit tests as long as the db is setup and cleaned up by the unit test itself. Having a real DB as a requirement for low level unit tests does two things that I don't like. First, it requires the configuration of a database (in our case, MySQL) as part of running the test. That's a build dependency that (IMO) shouldn't be needed. Second, configuring and using a real database significantly slows down the unit test process. For unit tests to be useful, they have to be as fast as possible. We simply don't have enough unit tests for this to be a major problem right now, but as the coverage increases (true unit tests, not integration tests) this will get much worse. In my ideal world, unit tests are limited in their test scope to only cover code within a particular object (inherited or directly accessed). Imported objects should usually be mocked. We might be arguing about nuance of definition here, but I've always tried to keep a bright red line between unit and integration tests. Both matter, but they test different things. > I think anything that requires starting of jetty is definitely not a unit test. Completely agree with this one. > --Alex >