Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 26048 invoked from network); 27 Dec 2009 19:19:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Dec 2009 19:19:35 -0000 Received: (qmail 79914 invoked by uid 500); 27 Dec 2009 19:19:34 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 79833 invoked by uid 500); 27 Dec 2009 19:19:34 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 79823 invoked by uid 99); 27 Dec 2009 19:19:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Dec 2009 19:19:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 209.85.160.56 as permitted sender) Received: from [209.85.160.56] (HELO mail-pw0-f56.google.com) (209.85.160.56) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Dec 2009 19:19:24 +0000 Received: by pwi19 with SMTP id 19so6791637pwi.35 for ; Sun, 27 Dec 2009 11:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=8lhveLV82zyWZ9uWwCIVrO2r19paRtQNEb7Gl6BDph0=; b=NrxiPpck5OVQ21mTa51euMr7pPxvcigl8c6XFFvw534Rk1zj3ex5hS8Qc/gU+Bh4TH 1O1SrOo79dsmmY61bsW+YP2PNK5M7GfedmF3VpeznolHBpT1BP24DLRqZ6SzDn/RCk9O NQXkJZS5zeP2EbdCsnhhAZ/fnyGrgcgLA9gM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=c8hqVjcnNncNKF4qI8UyJ/K7Z/QJ0n35laKVgkgt+GLsAG3OdcDOWHQBi0qbMOMFMu 7pVl5IwwFkDt00SVlXmJFd3aaCDT7RVJA7LsdbSYSoKtx2n5gKPZ2514ueDGwMTMpf5N TnFraEC5kQTRfwvcY8GCnxsdl/2BznZ27pAnU= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.142.119.4 with SMTP id r4mr7171475wfc.65.1261941542841; Sun, 27 Dec 2009 11:19:02 -0800 (PST) In-Reply-To: <1261940957.1399.121.camel@ana.amantes> References: <1261940957.1399.121.camel@ana.amantes> Date: Sun, 27 Dec 2009 11:19:02 -0800 X-Google-Sender-Auth: c2cbe9e2e52919c7 Message-ID: Subject: Re: unit testing view/show functions From: Chris Anderson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Dec 27, 2009 at 11:09 AM, Thomas Vander Stichele wrote: > Hi everyone, > > this is my first mail to this list. =A0Let's start by saying that I think > CouchDB is wonderful! > > I've been playing with it to write a Getting Things Done application so > that I can use it on my laptop, my two desktops, and my N900 phone. =A0So > far the good part. > > The bad part currently is that I have a lot of friction when trying to > write view/show functions. =A0Simple mistakes in my js code trigger > strange and cryptic warnings and problems in couchdb. =A0Without going > into much detail, the things that have happened to me: > > =A0- long waits, OS timeout errors from couchdb log > =A0- couchdb view server completely crashing, resulting in a 404 (with th= e > next request then connecting, but still failing) > =A0- long strings of numbers, longer than my terminal buffer, which I > think (with my limited knowledge of Erlang) are actual text documents > (in erlang, a string is really an array of numbers, right ?), but get > printed in this non-readable base format, filling up my terminal > scrollback buffer so I can't even see the errors in front of it. > What version of CouchDB are you using? I recently checked some work into trunk which should fix most of these problems, and I'd be curious to know if it helps in your case. As far as unit testing, it is possible to use CouchDB's JS test framework with custom test files. Don't run this test in Safari! Actually, I don't think it works at all, but looking at the code should show you how to make your own tests that use the Futon test runner. http://jchrisa.net/_utils/couch_tests.html?/drl/_design/sofa/tests.js I've actually had better luck using cucumber and rspec for this stuff, but I've got a Ruby background, so that makes sense to me. I'd be happy to hear what others are doing. Chris --=20 Chris Anderson http://jchrisa.net http://couch.io