couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: unit testing view/show functions
Date Sun, 27 Dec 2009 19:19:02 GMT
On Sun, Dec 27, 2009 at 11:09 AM, Thomas Vander Stichele
<> wrote:
> Hi everyone,
> this is my first mail to this list.  Let'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.  So
> far the good part.
> The bad part currently is that I have a lot of friction when trying to
> write view/show functions.  Simple mistakes in my js code trigger
> strange and cryptic warnings and problems in couchdb.  Without going
> into much detail, the things that have happened to me:
>  - long waits, OS timeout errors from couchdb log
>  - couchdb view server completely crashing, resulting in a 404 (with the
> next request then connecting, but still failing)
>  - 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.

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 Anderson

View raw message