Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 25368 invoked from network); 16 Feb 2009 14:38:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2009 14:38:19 -0000 Received: (qmail 5318 invoked by uid 500); 16 Feb 2009 14:38:19 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 4982 invoked by uid 500); 16 Feb 2009 14:38:18 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 4971 invoked by uid 99); 16 Feb 2009 14:38:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Feb 2009 06:38:18 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dionne@dionne-associates.com designates 67.222.54.250 as permitted sender) Received: from [67.222.54.250] (HELO outbound-mail-318.bluehost.com) (67.222.54.250) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 16 Feb 2009 14:38:09 +0000 Received: (qmail 14695 invoked by uid 0); 16 Feb 2009 14:33:02 -0000 Received: from unknown (HELO host183.hostmonster.com) (74.220.207.183) by outboundproxy6.bluehost.com with SMTP; 16 Feb 2009 14:33:02 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=dionne-associates.com; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer:X-Identified-User; b=dCcOwHqax5tVQsuHDiol6GhZxEOdWHnkjdEvD9HFJcmR9HkAq00z479Qa65jM7TjgJS8i+coEjqU5OsQRZ/DdLDcL4AgKwaUjNuow7si5supeIidbDZMRKJxcffAsprL; Received: from h-69-3-193-84.nycmny83.dynamic.covad.net ([69.3.193.84] helo=[192.168.2.100]) by host183.hostmonster.com with esmtpa (Exim 4.69) (envelope-from ) id 1LZ4b7-00036x-JX for dev@couchdb.apache.org; Mon, 16 Feb 2009 07:37:25 -0700 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <1F552D0F-A893-49E4-BC1D-1E0743410E50@apache.org> References: <52FC71A1-9758-47CE-B8BE-79F5D704B867@apache.org> <83A73DE5-5405-4B42-B335-8A25DB4A9AEF@apache.org> <4001C44E-C9FE-4643-821C-7C979E929D8E@apache.org> <3A88CA1A-DE67-465A-BE7C-63CEF50DC57E@apache.org> <944EE9A7-FA9E-4947-BF80-00A501B619E3@apache.org> <30FBC068-299C-47A6-ADAA-A5437AF05F22@dionne-associates.com> <1F552D0F-A893-49E4-BC1D-1E0743410E50@apache.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <7A46294D-5667-4D99-AE51-4D0E526BCBFD@dionne-associates.com> Content-Transfer-Encoding: 7bit From: Robert Dionne Subject: Re: [PATCH] Eunit Tests Date: Mon, 16 Feb 2009 09:36:40 -0500 To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.753.1) X-Identified-User: {2551:host183.hostmonster.com:dionneas:dionne-associates.com} {sentby:smtp auth 69.3.193.84 authed with dionne@dionne-associates.com} X-Virus-Checked: Checked by ClamAV on apache.org On Feb 16, 2009, at 8:03 AM, Jan Lehnardt wrote: > > On 16 Feb 2009, at 13:37, Robert Dionne wrote: > >>> Pure unit-test logic would suggest creating a couch_btree_chunker >>> module. Like how I did with couch_config and couch_config_writer. >>> But then, pragmatism will call heresy and I'd probably agree. >> >> For sure, "In theory there's no difference between theory and >> practice, but in practice there is" :) > > The question is if we want to "do it right" now or KISS our way out > of this? > > >>> The only problem I see here is that tests belonging to a single >>> module >>> are run in different places and you'd have to track down where >>> the test >> >> hmm... actually according to the docs if you run eunit:test >> ([couch_btree]) it does both (I haven't tested this yet). In >> other words it ensures couch_btree:test() is run and also finds >> and runs tests in couch_btree_tests. So if I read this correctly >> it solve this issue, non? > > You're right, I just tested this, nice. > > >> Oh I see, it wouldn't tell you which ones failed? > > No no, it does. All is well :) > > > I'd suggest we establish this guidelines for writing tests: > > - A module's public API should be tested in a separate module as > it helps > refining the public API, keeps files at a manageable size and > changes > to either tests or the module don't interfere with each other > (plus all the > good thing Michael McDaniel pointed out earlier). > > - A module's private API is tested using inline-tests. > > - Large* modules should be considered for split-ups keep things more > manageable. > > *Large is defined pragmatically on a case-by-case basis. > > > What do you think? +1 (if I get a vote :) I agree completely. As I count the files in src/couchdb (32 and growing) I think it's a good time to start this, even if new tests are only added opportunistically as bugs are fixed, etc... When 1.0 comes along and larger new features added these will serve us well. Danke vielmals! > > Cheers > Jan > -- >