You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Damien Katz <da...@apache.org> on 2009/02/13 19:02:08 UTC

Ideas for Changes to the Test Suite

So there have been some grumbling that the test suite could use some  
changes.

A small problem I see is the use of couch.js in the tests.  I'd  
personally like to remove the Javascript couch.js library usage from  
the tests and instead use more naked HTTP calls and simple sub-routines.

My biggest reason is clarity, the tests are like documentation and by  
removing a layer of abstraction the tests are easier to understand for  
exactly what they are testing. A simpler (if longer) test  
implementation makes it easier to build and debug libraries for other  
platforms.

My other reason to drop couch.js from the test is it risks becoming  
the defacto JS library, and not a very good one. Because we are trying  
to keep it simple for the tests, it doesn't have lots of features that  
would be more useful for real development (like async support). I'd  
prefer couch.js be exactly what it needs to be for useful in a browser  
without serving the needs of the test suite.

I'd like to know what others thing about that idea. It's a big task,  
lots of code in the test to modify.

A bigger problem is the tests are just getting numerous and not very  
well organized. And it's only getting worse. I'm thinking we need to  
categorize the tests somehow to run subsets easily, but I don't have  
any concrete ideas. Suggestions welcome.

-Damien



Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
On Sat, Feb 14, 2009 at 1:23 PM, Damien Katz <da...@apache.org> wrote:
> So based on the responses, it looks like we need fully automated tests,
> runnable without the browser. And Erlang unit test integration.
>
> Also people like running the tests in the browser and want even better
> integration for creating new tests. I see no reason we cannot have both.
> Chris Anderson has done a lot of work here already.
>
> Looks like couch.js is fine as is.
>
> Paul, I'm not sure why you object to long test names, but I do like the idea
> of tags for tests. Each test could be tagged for important functionality
> they test and use: replication, security, views, temp views, compaction,
> etc. That it makes it easy to quickly run all the tests touching certain
> features while you are developing. As the number of tests grow, this will
> become more useful IMO.
>
> -Damien
>

Damien,

Long test names fail to pass my cost/benefit analysis.

The awesomeness of tags would be highly dependent on implementation.

HTH,
Paul Davis

Re: Ideas for Changes to the Test Suite

Posted by Damien Katz <da...@apache.org>.
So based on the responses, it looks like we need fully automated  
tests, runnable without the browser. And Erlang unit test integration.

Also people like running the tests in the browser and want even better  
integration for creating new tests. I see no reason we cannot have  
both. Chris Anderson has done a lot of work here already.

Looks like couch.js is fine as is.

Paul, I'm not sure why you object to long test names, but I do like  
the idea of tags for tests. Each test could be tagged for important  
functionality they test and use: replication, security, views, temp  
views, compaction, etc. That it makes it easy to quickly run all the  
tests touching certain features while you are developing. As the  
number of tests grow, this will become more useful IMO.

-Damien

Re: Ideas for Changes to the Test Suite

Posted by Chris Anderson <jc...@apache.org>.
On Fri, Feb 13, 2009 at 4:03 PM, Jan Lehnardt <ja...@apache.org> wrote:
>
> On 14 Feb 2009, at 00:55, Antony Blakey wrote:
>
>> We shouldn't have in-browser tests. In-browser tests are about testing the
>> browser, which we shouldn't do in this project. Our tests should be about
>> Couch, on the command-line, build-farm-integratable.
>
> We have both and we can keep both as both are useful.
> Given that CouchApps are a first class citizen, browser
> based tests make a lot of sense.
>

+1 We do have ./runner.sh to run the same tests on the command line.

My suggestion, that we should concentrate on getting the Erlang unit
tests easily accessible on the command line, is meant to be pragmatic.
Once we have a make target that runs tests, we can integrate it with
the command-line JS tests. So there can be an option to run the
integration suite as well as the unit suite.

We're just a couple of code-hours away from getting an Erlang unit
test make target, so once that's solid, we can work on making the JS
integration tests easier to run without a browser.

Browser variation isn't a problem, as the tests are only supported in
Firefox 3 (and not some broken beta version of it).

We could bike-shed this but I think it's better just to get `make
test` and `make test-js` solid.

Chris

-- 
Chris Anderson
http://jchris.mfdz.com

Re: Ideas for Changes to the Test Suite

Posted by Robert Dionne <di...@dionne-associates.com>.
On Feb 13, 2009, at 7:03 PM, Jan Lehnardt wrote:

>
> On 14 Feb 2009, at 00:55, Antony Blakey wrote:
>
>> We shouldn't have in-browser tests. In-browser tests are about  
>> testing the browser, which we shouldn't do in this project. Our  
>> tests should be about Couch, on the command-line, build-farm- 
>> integratable.
>
> We have both and we can keep both as both are useful.
> Given that CouchApps are a first class citizen, browser
> based tests make a lot of sense.

I second this, the browser is a an app critical to CouchDB's success.  
When I svn update I run the Futon tests in Safari, Firefox, Webkit  
and using standalone runner. The more application paths to the server  
to more bugs are exposed.

It was suggested earlier that we use Eunit (http://svn.process- 
one.net/contribs/trunk/eunit/doc/overview-summary.html). It's got  
some nice features and macros for building suites of tests, timers,  
etc...

With a proper header the build could run Eunits and also strip the  
test code from the distribution if desired, though I think they are  
useful for code readers to learn the code.

I also prefer tests in separate modules, certain modules, .eg.  
couch_btree or any module with lots of private functions are best  
with tests in the files. Eunit supports both modes nicely with naming  
conventions. There is even a LET macro for fans of lambda calculus :)




>
> Cheers
> Jan
> --
>


Re: Ideas for Changes to the Test Suite

Posted by Jan Lehnardt <ja...@apache.org>.
On 14 Feb 2009, at 00:55, Antony Blakey wrote:

> We shouldn't have in-browser tests. In-browser tests are about  
> testing the browser, which we shouldn't do in this project. Our  
> tests should be about Couch, on the command-line, build-farm- 
> integratable.

We have both and we can keep both as both are useful.
Given that CouchApps are a first class citizen, browser
based tests make a lot of sense.

Cheers
Jan
--


Re: Ideas for Changes to the Test Suite

Posted by Antony Blakey <an...@gmail.com>.
On 14/02/2009, at 10:43 AM, Paul Davis wrote:

> If the intention of the code is clear then why bother repeating the
> intention, why bother repeating the intention when the code is clear?
> See, its fucked up.

No, your comment proves nothing.

Anyway, there's a lot of literature on this subject, so you and I  
arguing the point from scratch isn't efficient. Let's agree to disagree.

> The scheme I was suggesting was keeping around a small set of tests to
> check browser compliance with JS funcitonality that CouchDB requires.
> Things like making sure your XHR can do DELETE's (which is a bug in
> Opera we've run into).

My point is that these kinds of test are generally useful, outside of  
Couch, as a separate project. Carefactor < epsilon :)

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

The ultimate measure of a man is not where he stands in moments of  
comfort and convenience, but where he stands at times of challenge and  
controversy.
   -- Martin Luther King



Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Feb 13, 2009 at 6:55 PM, Antony Blakey <an...@gmail.com> wrote:
>
> On 14/02/2009, at 10:09 AM, Paul Davis wrote:
>
>> Tests should be identifiable obviously, but if you want literature in
>> your code, go write AppleScript.
>
> Code should prioritize easy comprehensibility, especially given that there's
> no separate documentation. You're obviously not a literate programming fan
> :)
>

If the intention of the code is clear then why bother repeating the
intention, why bother repeating the intention when the code is clear?
See, its fucked up. If you need to point out something subtle, then
use a comment.

> And if you want terseness, got write APL - I did that for two years, and
> it's a heap of fun.
>
>>> Our requirements are a working HTTP client implementation, and a
>>> browser's
>>> conformance to that isn't about it's Couch support. I think this should
>>> be a
>>> separate project.
>>
>> I'm confused by the the argument that we should treat in browser tests
>> differently for a vote against treating in-browser tests differently.
>
> We shouldn't have in-browser tests. In-browser tests are about testing the
> browser, which we shouldn't do in this project. Our tests should be about
> Couch, on the command-line, build-farm-integratable.
>
> If those tests are also runnable from the browser, just for chuckles, then
> fine, but that's not the canonical environment because it introduces another
> variable into the mix.
>

The scheme I was suggesting was keeping around a small set of tests to
check browser compliance with JS funcitonality that CouchDB requires.
Things like making sure your XHR can do DELETE's (which is a bug in
Opera we've run into).

Otherwise I think we're in total agreement.

> Antony Blakey
> -------------
> CTO, Linkuistics Pty Ltd
> Ph: 0438 840 787
>
> He who would make his own liberty secure, must guard even his enemy from
> repression.
>  -- Thomas Paine
>
>
>

HTH,
Paul Davis

Re: Ideas for Changes to the Test Suite

Posted by Antony Blakey <an...@gmail.com>.
On 14/02/2009, at 10:09 AM, Paul Davis wrote:

> Tests should be identifiable obviously, but if you want literature in
> your code, go write AppleScript.

Code should prioritize easy comprehensibility, especially given that  
there's no separate documentation. You're obviously not a literate  
programming fan :)

And if you want terseness, got write APL - I did that for two years,  
and it's a heap of fun.

>> Our requirements are a working HTTP client implementation, and a  
>> browser's
>> conformance to that isn't about it's Couch support. I think this  
>> should be a
>> separate project.
>
> I'm confused by the the argument that we should treat in browser tests
> differently for a vote against treating in-browser tests differently.

We shouldn't have in-browser tests. In-browser tests are about testing  
the browser, which we shouldn't do in this project. Our tests should  
be about Couch, on the command-line, build-farm-integratable.

If those tests are also runnable from the browser, just for chuckles,  
then fine, but that's not the canonical environment because it  
introduces another variable into the mix.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

He who would make his own liberty secure, must guard even his enemy  
from repression.
   -- Thomas Paine



Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Feb 13, 2009 at 6:23 PM, Antony Blakey <an...@gmail.com> wrote:
>
> On 14/02/2009, at 5:00 AM, Paul Davis wrote:
>
>> 1. NO LONG ASS TEST NAMES.
>
> -1
>
> OTOH, I'd like namespaced tests, so each node isn't a paragraph, but the
> fully qualified form is cf. ruby's rspec et al.
>

Tests should be identifiable obviously, but if you want literature in
your code, go write AppleScript.

>> 2. I'd still argue that we shouldn't be using a browser as our native
>> test runner.
>
> +1
>
> The canonical runner should be a command-line tool so it can be integrated
> into non-gui builds.
>
>> If people want to have a set of tests for a browser as in "Your
>> browser must support this set of operations to be used with CouchDB"
>> I'm all for it, but other wise its just adding headaches.
>
> -1
>
> Our requirements are a working HTTP client implementation, and a browser's
> conformance to that isn't about it's Couch support. I think this should be a
> separate project.
>

I'm confused by the the argument that we should treat in browser tests
differently for a vote against treating in-browser tests differently.

>> Making test cases smaller and more focused is a good thing.
>
> +1
>
> There should be only one issue actually under test, but some test require
> considerable context.
>
>> And I'd argue for one file per test.
>
> -1
>
>> 4. Crazy idea on tagging. This is a bit off the deep end, but it'd be
>> kinda neat to have tagging support for tests. then if you have 5
>> seemingly random tests fail you'd realize that they all touch the
>> _uuid's endpoint or something. Just a random thought.
>
> -1
>
> I think this is over-engineering, and unlikely to be maintained correctly.
>

I agree. But it sure would be neato :D

> Antony Blakey
> -------------
> CTO, Linkuistics Pty Ltd
> Ph: 0438 840 787
>
> Every task involves constraint,
> Solve the thing without complaint;
> There are magic links and chains
> Forged to loose our rigid brains.
> Structures, structures, though they bind,
> Strangely liberate the mind.
>  -- James Fallen
>
>
>

HTH,
Paul Davis

Re: Ideas for Changes to the Test Suite

Posted by Antony Blakey <an...@gmail.com>.
On 14/02/2009, at 5:00 AM, Paul Davis wrote:

> 1. NO LONG ASS TEST NAMES.

-1

OTOH, I'd like namespaced tests, so each node isn't a paragraph, but  
the fully qualified form is cf. ruby's rspec et al.

> 2. I'd still argue that we shouldn't be using a browser as our native
> test runner.

+1

The canonical runner should be a command-line tool so it can be  
integrated into non-gui builds.

> If people want to have a set of tests for a browser as in "Your
> browser must support this set of operations to be used with CouchDB"
> I'm all for it, but other wise its just adding headaches.

-1

Our requirements are a working HTTP client implementation, and a  
browser's conformance to that isn't about it's Couch support. I think  
this should be a separate project.

> Making test cases smaller and more focused is a good thing.

+1

There should be only one issue actually under test, but some test  
require considerable context.

> And I'd argue for one file per test.

-1

> 4. Crazy idea on tagging. This is a bit off the deep end, but it'd be
> kinda neat to have tagging support for tests. then if you have 5
> seemingly random tests fail you'd realize that they all touch the
> _uuid's endpoint or something. Just a random thought.

-1

I think this is over-engineering, and unlikely to be maintained  
correctly.

Antony Blakey
-------------
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Every task involves constraint,
Solve the thing without complaint;
There are magic links and chains
Forged to loose our rigid brains.
Structures, structures, though they bind,
Strangely liberate the mind.
   -- James Fallen



Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Feb 13, 2009 at 3:13 PM, Chris Anderson <jc...@apache.org> wrote:
> On Fri, Feb 13, 2009 at 12:07 PM, Zachary Zolton
> <za...@gmail.com> wrote:
>> I know John Resig produced some interesting work, WRT unit testing
>> browser-based JavaScript:
>>
>> http://ejohn.org/projects/bringing-the-browser-to-the-server/
>>
>> Something like this might suffice for those who would like to run
>> CouchDB's JavaScript test suite outside of the browser...?
>>
>
> We've got the basics of a command line JS runner in the package
> currently. It's big problem is that it requires a running couchdb on
> localhost:5984 in order to work. To run:
>

The browser requires a running trunk too though. :D

> cd test/ && ./runner.sh
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Re: Ideas for Changes to the Test Suite

Posted by Chris Anderson <jc...@apache.org>.
On Fri, Feb 13, 2009 at 12:07 PM, Zachary Zolton
<za...@gmail.com> wrote:
> I know John Resig produced some interesting work, WRT unit testing
> browser-based JavaScript:
>
> http://ejohn.org/projects/bringing-the-browser-to-the-server/
>
> Something like this might suffice for those who would like to run
> CouchDB's JavaScript test suite outside of the browser...?
>

We've got the basics of a command line JS runner in the package
currently. It's big problem is that it requires a running couchdb on
localhost:5984 in order to work. To run:

cd test/ && ./runner.sh

-- 
Chris Anderson
http://jchris.mfdz.com

Re: Ideas for Changes to the Test Suite

Posted by Zachary Zolton <za...@gmail.com>.
I know John Resig produced some interesting work, WRT unit testing
browser-based JavaScript:

http://ejohn.org/projects/bringing-the-browser-to-the-server/

Something like this might suffice for those who would like to run
CouchDB's JavaScript test suite outside of the browser...?

On Fri, Feb 13, 2009 at 2:02 PM, Zachary Zolton
<za...@gmail.com> wrote:
> I second what JChris said. I wouldn't have been nervous about making
> my first patch — even though involve some Erlang code — if there
> wasn't that easy-to-grasp JavaScript test harness.
>
> On Fri, Feb 13, 2009 at 12:52 PM, Chris Anderson <jc...@apache.org> wrote:
>> On Fri, Feb 13, 2009 at 10:30 AM, Paul Davis
>> <pa...@gmail.com> wrote:
>>>
>>> 2. I'd still argue that we shouldn't be using a browser as our native
>>> test runner. We'd have to give up the little green check marks that
>>> make us all feel warm and fuzzy when tests pass, but the browser is a
>>> huge ass confounding variable.
>>
>> I know for sure that in-browser tests are a big part of what brought
>> me to CouchDB. They tell the story of a web-native database in a way
>> that nothing else can really touch. They also make it *incredibly
>> easy* for newcomers to contribute.
>>
>>>To me, a proper test suite would be run
>>> from directly from the command line. We have the hacked together test
>>> runner, but not many people seem to use it regularly because we have
>>> the fancy green check marks.
>>>
>>
>> I think we're starting to feel the lack of Erlang unit tests. They
>> sure would have helped me in my last few patches, and they'd make a
>> decent beginning for documenting our native Erlang API.
>>
>> I think once we get the few Erlang tests that are already written,
>> integrated into the build, and make it easy to add new ones, they will
>> become the primary command-line test suite.
>>
>> Chris
>>
>> --
>> Chris Anderson
>> http://jchris.mfdz.com
>>
>

Re: Ideas for Changes to the Test Suite

Posted by Zachary Zolton <za...@gmail.com>.
I second what JChris said. I wouldn't have been nervous about making
my first patch — even though involve some Erlang code — if there
wasn't that easy-to-grasp JavaScript test harness.

On Fri, Feb 13, 2009 at 12:52 PM, Chris Anderson <jc...@apache.org> wrote:
> On Fri, Feb 13, 2009 at 10:30 AM, Paul Davis
> <pa...@gmail.com> wrote:
>>
>> 2. I'd still argue that we shouldn't be using a browser as our native
>> test runner. We'd have to give up the little green check marks that
>> make us all feel warm and fuzzy when tests pass, but the browser is a
>> huge ass confounding variable.
>
> I know for sure that in-browser tests are a big part of what brought
> me to CouchDB. They tell the story of a web-native database in a way
> that nothing else can really touch. They also make it *incredibly
> easy* for newcomers to contribute.
>
>>To me, a proper test suite would be run
>> from directly from the command line. We have the hacked together test
>> runner, but not many people seem to use it regularly because we have
>> the fancy green check marks.
>>
>
> I think we're starting to feel the lack of Erlang unit tests. They
> sure would have helped me in my last few patches, and they'd make a
> decent beginning for documenting our native Erlang API.
>
> I think once we get the few Erlang tests that are already written,
> integrated into the build, and make it easy to add new ones, they will
> become the primary command-line test suite.
>
> Chris
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Re: Ideas for Changes to the Test Suite

Posted by Dirkjan Ochtman <di...@ochtman.nl>.
On 13/02/2009 19:52, Chris Anderson wrote:
> I know for sure that in-browser tests are a big part of what brought
> me to CouchDB. They tell the story of a web-native database in a way
> that nothing else can really touch. They also make it *incredibly
> easy* for newcomers to contribute.

They also make it incredibly easy for newcomers to get confused, due to 
the involvement of the browser. That is, I ran the tests using Firefox 
3.1b2, and they crapped all over themselves. Of course I thought I 
hadn't installed Couch just right; but it was the browser's fault in 
this case. I agree that the in-browser test suite is incredibly snazzy, 
but I definitely feel for Paul's argument about more basic testing, too.

Cheers,

Dirkjan

Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
On Fri, Feb 13, 2009 at 1:52 PM, Chris Anderson <jc...@apache.org> wrote:
> On Fri, Feb 13, 2009 at 10:30 AM, Paul Davis
> <pa...@gmail.com> wrote:
>>
>> 2. I'd still argue that we shouldn't be using a browser as our native
>> test runner. We'd have to give up the little green check marks that
>> make us all feel warm and fuzzy when tests pass, but the browser is a
>> huge ass confounding variable.
>
> I know for sure that in-browser tests are a big part of what brought
> me to CouchDB. They tell the story of a web-native database in a way
> that nothing else can really touch. They also make it *incredibly
> easy* for newcomers to contribute.
>

Heh. I actually took a while to come around to the idea of the pure
couch application. I see your point and I raise you though. I'm all
for some snazzy looking tests in the browser, but I would argue that
if we went with doing the basics for browser interaction we'd be set.
Ie, CRUD operations, checking out _uuids and _bulk_docs etc etc. I'm
thinking the Futon test suite could be similar to what it is, but
instead of  testing your couchdb install, it's testing your browser's
conformance to working with CouchDB. Hell, we could even start a wiki
page for "These browsers have passed the CouchDB test suite" type of
thing. or run one of those render things on it too.

>>To me, a proper test suite would be run
>> from directly from the command line. We have the hacked together test
>> runner, but not many people seem to use it regularly because we have
>> the fancy green check marks.
>>
>
> I think we're starting to feel the lack of Erlang unit tests. They
> sure would have helped me in my last few patches, and they'd make a
> decent beginning for documenting our native Erlang API.
>
> I think once we get the few Erlang tests that are already written,
> integrated into the build, and make it easy to add new ones, they will
> become the primary command-line test suite.
>

eunit tests are definitely important as well, but they're testing
something completely different. I tend to look at my testing as a
large tree. unit tests are at the very bottom making sure specific
functions are working, then we test different combinations, and etc
etc until we're at the top testing the  user API. Purists hate me for
saying that because they think that *everything* should be tested
independently. I hate purists though so it all evens out.

> Chris
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Also, s/trunk/host/ in my last.

HTH,
Paul Davis

Re: Ideas for Changes to the Test Suite

Posted by Chris Anderson <jc...@apache.org>.
On Fri, Feb 13, 2009 at 10:30 AM, Paul Davis
<pa...@gmail.com> wrote:
>
> 2. I'd still argue that we shouldn't be using a browser as our native
> test runner. We'd have to give up the little green check marks that
> make us all feel warm and fuzzy when tests pass, but the browser is a
> huge ass confounding variable.

I know for sure that in-browser tests are a big part of what brought
me to CouchDB. They tell the story of a web-native database in a way
that nothing else can really touch. They also make it *incredibly
easy* for newcomers to contribute.

>To me, a proper test suite would be run
> from directly from the command line. We have the hacked together test
> runner, but not many people seem to use it regularly because we have
> the fancy green check marks.
>

I think we're starting to feel the lack of Erlang unit tests. They
sure would have helped me in my last few patches, and they'd make a
decent beginning for documenting our native Erlang API.

I think once we get the few Erlang tests that are already written,
integrated into the build, and make it easy to add new ones, they will
become the primary command-line test suite.

Chris

-- 
Chris Anderson
http://jchris.mfdz.com

Re: Ideas for Changes to the Test Suite

Posted by Paul Davis <pa...@gmail.com>.
Couple of thoughts:

1. NO LONG ASS TEST NAMES.

2. I'd still argue that we shouldn't be using a browser as our native
test runner. We'd have to give up the little green check marks that
make us all feel warm and fuzzy when tests pass, but the browser is a
huge ass confounding variable. To me, a proper test suite would be run
from directly from the command line. We have the hacked together test
runner, but not many people seem to use it regularly because we have
the fancy green check marks.

If people want to have a set of tests for a browser as in "Your
browser must support this set of operations to be used with CouchDB"
I'm all for it, but other wise its just adding headaches.

Also, making sure that all data is run from the command line means we
can integrate it into a build bot. This means we know who to yell at
if someone breaks trunk. This is a good thing IMO.

3. My spoon is tooooo big! Or the tests in this case. But its funnier
with the talking banana mental image. Making test cases smaller and
more focused is a good thing. Some sort of shallow directory layout
could be useful for categorization. And I'd argue for one file per
test.

4. Crazy idea on tagging. This is a bit off the deep end, but it'd be
kinda neat to have tagging support for tests. then if you have 5
seemingly random tests fail you'd realize that they all touch the
_uuid's endpoint or something. Just a random thought.

5. Also, there's an issue on JIRA to get a page so that people can
write tests cases from within Futon. Hopefully this would motivate new
people in the community to write tests that they can then upload to
JIRA (manually, of course, lawyers ftw).

6. I don't really have an opinion on couch.js. I can see both Damien
and Chris's arguments but I'm not overly concerned. When I was playing
with ajaxy bling with CouchDB I was just using jquery's normal ajax
support without any sort of library. The API is so thin I didn't even
stop to think that I'd want a  library in the first place. Granted I'm
a bit familiar with the API.

7. NO DAMN PARAGRAPHS FOR TEST NAMES. 4SRS!

I have no idea why I made that a numbered list. But I'm too lazy to
change it now.

HTH,
Paul Davis

On Fri, Feb 13, 2009 at 1:02 PM, Damien Katz <da...@apache.org> wrote:
> So there have been some grumbling that the test suite could use some
> changes.
>
> A small problem I see is the use of couch.js in the tests.  I'd personally
> like to remove the Javascript couch.js library usage from the tests and
> instead use more naked HTTP calls and simple sub-routines.
>
> My biggest reason is clarity, the tests are like documentation and by
> removing a layer of abstraction the tests are easier to understand for
> exactly what they are testing. A simpler (if longer) test implementation
> makes it easier to build and debug libraries for other platforms.
>
> My other reason to drop couch.js from the test is it risks becoming the
> defacto JS library, and not a very good one. Because we are trying to keep
> it simple for the tests, it doesn't have lots of features that would be more
> useful for real development (like async support). I'd prefer couch.js be
> exactly what it needs to be for useful in a browser without serving the
> needs of the test suite.
>
> I'd like to know what others thing about that idea. It's a big task, lots of
> code in the test to modify.
>
> A bigger problem is the tests are just getting numerous and not very well
> organized. And it's only getting worse. I'm thinking we need to categorize
> the tests somehow to run subsets easily, but I don't have any concrete
> ideas. Suggestions welcome.
>
> -Damien
>
>
>

Re: Ideas for Changes to the Test Suite

Posted by Jan Lehnardt <ja...@apache.org>.
On 14 Feb 2009, at 18:59, kowsik wrote:
> What we could do is to have a shell test-runner (in addition to the
> browser) that uses spider monkey to execute the same set of tests.
> This way you write the tests once and it works both within the browser
> and the shell.

We have that. Run `make test` in trunk. :)

Cheers
Jan
--


>
>
> K.
>
> On Fri, Feb 13, 2009 at 10:36 AM, Damien Katz <da...@apache.org>  
> wrote:
>>
>> On Feb 13, 2009, at 1:09 PM, Chris Anderson wrote:
>>
>>> On Fri, Feb 13, 2009 at 10:02 AM, Damien Katz <da...@apache.org>  
>>> wrote:
>>>>
>>>> My other reason to drop couch.js from the test is it risks  
>>>> becoming the
>>>> defacto JS library, and not a very good one. Because we are  
>>>> trying to
>>>> keep
>>>> it simple for the tests, it doesn't have lots of features that  
>>>> would be
>>>> more
>>>> useful for real development (like async support). I'd prefer  
>>>> couch.js be
>>>> exactly what it needs to be for useful in a browser without  
>>>> serving the
>>>> needs of the test suite.
>>>
>>> That's funny, I've had sort of the opposite perspective. For
>>> in-browser development, the Futon jQuery CouchDB library seems like
>>> the defacto stadard. It supports asynchronous calls and has a nicer
>>> abstraction layer than couch.js.
>>
>>>
>>>
>>> OTOH, couch.js makes a great reference for building non-JavaScript
>>> libraries, as most languages don't use the asynchronous http request
>>> model that JavaScript tends to, but couch.js avoids. I think that if
>>> we concentrate on keeping couch.js at the right level of abstraction
>>> for the test suite, we'll be happiest.
>>>
>>> I agree that the test suite needs cleanup, but I don't think pulling
>>> couch.js out of it will make it any clearer.
>>
>> I don't do much browser development, so I'll concede I could be  
>> completely
>> wrong about how couch.js is perceived and used.
>>
>> -Damien
>>
>


Re: Ideas for Changes to the Test Suite

Posted by kowsik <ko...@gmail.com>.
When I first started playing with couch, couch.js was all I had as an
awesome reference. I really like the idea of doing tests from within
the browser. With jQuery + FF3 console, it makes playing around with
couch incredibly easy. More so than curl + shell.

I would very much prefer to keep all the tests within the browser. For
one you can generate pretty looking reports + test failures that
directly file bugs in JIRA with a couple of REST calls and JSONP. ;-)

What we could do is to have a shell test-runner (in addition to the
browser) that uses spider monkey to execute the same set of tests.
This way you write the tests once and it works both within the browser
and the shell.

K.

On Fri, Feb 13, 2009 at 10:36 AM, Damien Katz <da...@apache.org> wrote:
>
> On Feb 13, 2009, at 1:09 PM, Chris Anderson wrote:
>
>> On Fri, Feb 13, 2009 at 10:02 AM, Damien Katz <da...@apache.org> wrote:
>>>
>>> My other reason to drop couch.js from the test is it risks becoming the
>>> defacto JS library, and not a very good one. Because we are trying to
>>> keep
>>> it simple for the tests, it doesn't have lots of features that would be
>>> more
>>> useful for real development (like async support). I'd prefer couch.js be
>>> exactly what it needs to be for useful in a browser without serving the
>>> needs of the test suite.
>>
>> That's funny, I've had sort of the opposite perspective. For
>> in-browser development, the Futon jQuery CouchDB library seems like
>> the defacto stadard. It supports asynchronous calls and has a nicer
>> abstraction layer than couch.js.
>
>>
>>
>> OTOH, couch.js makes a great reference for building non-JavaScript
>> libraries, as most languages don't use the asynchronous http request
>> model that JavaScript tends to, but couch.js avoids. I think that if
>> we concentrate on keeping couch.js at the right level of abstraction
>> for the test suite, we'll be happiest.
>>
>> I agree that the test suite needs cleanup, but I don't think pulling
>> couch.js out of it will make it any clearer.
>
> I don't do much browser development, so I'll concede I could be completely
> wrong about how couch.js is perceived and used.
>
> -Damien
>

Re: Ideas for Changes to the Test Suite

Posted by Damien Katz <da...@apache.org>.
On Feb 13, 2009, at 1:09 PM, Chris Anderson wrote:

> On Fri, Feb 13, 2009 at 10:02 AM, Damien Katz <da...@apache.org>  
> wrote:
>> My other reason to drop couch.js from the test is it risks becoming  
>> the
>> defacto JS library, and not a very good one. Because we are trying  
>> to keep
>> it simple for the tests, it doesn't have lots of features that  
>> would be more
>> useful for real development (like async support). I'd prefer  
>> couch.js be
>> exactly what it needs to be for useful in a browser without serving  
>> the
>> needs of the test suite.
>
> That's funny, I've had sort of the opposite perspective. For
> in-browser development, the Futon jQuery CouchDB library seems like
> the defacto stadard. It supports asynchronous calls and has a nicer
> abstraction layer than couch.js.

>
>
> OTOH, couch.js makes a great reference for building non-JavaScript
> libraries, as most languages don't use the asynchronous http request
> model that JavaScript tends to, but couch.js avoids. I think that if
> we concentrate on keeping couch.js at the right level of abstraction
> for the test suite, we'll be happiest.
>
> I agree that the test suite needs cleanup, but I don't think pulling
> couch.js out of it will make it any clearer.

I don't do much browser development, so I'll concede I could be  
completely wrong about how couch.js is perceived and used.

-Damien

Re: Ideas for Changes to the Test Suite

Posted by Chris Anderson <jc...@apache.org>.
On Fri, Feb 13, 2009 at 10:02 AM, Damien Katz <da...@apache.org> wrote:
> My other reason to drop couch.js from the test is it risks becoming the
> defacto JS library, and not a very good one. Because we are trying to keep
> it simple for the tests, it doesn't have lots of features that would be more
> useful for real development (like async support). I'd prefer couch.js be
> exactly what it needs to be for useful in a browser without serving the
> needs of the test suite.

That's funny, I've had sort of the opposite perspective. For
in-browser development, the Futon jQuery CouchDB library seems like
the defacto stadard. It supports asynchronous calls and has a nicer
abstraction layer than couch.js.

OTOH, couch.js makes a great reference for building non-JavaScript
libraries, as most languages don't use the asynchronous http request
model that JavaScript tends to, but couch.js avoids. I think that if
we concentrate on keeping couch.js at the right level of abstraction
for the test suite, we'll be happiest.

I agree that the test suite needs cleanup, but I don't think pulling
couch.js out of it will make it any clearer.

Chris

-- 
Chris Anderson
http://jchris.mfdz.com