DESCRIPTION

Enhance view query testing

major code refactoring
    * added more start_key end_key queries with verification
    * new map functions that emit array as keys with dupe entries
    * support for variety of datasets with predictive load functions
      so that we know what to expect when its queried
NOTE: startkey_docid tests currently failing

Change-Id: I1d7ef8e34f986319f77aca851559406234aac0ba


COMMENTS

author: Titus Ho
date: 2012-02-10 01:46:00.577000000

Uploaded patch set 2.

-------------------------------------
author: Reid Stokes
date: 2012-02-10 02:17:50.064000000

Patch Set 2:

FYI.. 
we also have beer dataset available.

-------------------------------------
author: Ayla Reynolds
date: 2012-02-10 12:40:37.238000000

Patch Set 2: Verified; I would prefer that you didn't submit this

(6 inline comments)

Great work! I've only minor nitpicks.

Though one thing about the stale tests. Shouldn't the tests also test if the stale options work as expected? At the moment you only test whether they return the correct results, but not their behavior. E.g. could stale=update_after wait until the View is processed and not return immediately and then trigger the processing. The tests wouldn't catch that.

Line:186, pytests/viewquerytests.py -> I prefer the more Pythonic way:

self.prefix = prefix if prefix is not None else default_prefix

or

self.prefix = default_prefix if prefix is None else prefix

Though it's a matter of taste, hence not a blocker.

Line:228, pytests/viewquerytests.py -> Getting the results and getting the number of keys is repeated in the loop.

What about putting the whole thing in a loop and having the querying only in one place?

Line:335, pytests/viewquerytests.py -> Why encoding as ASCII. Wouldn't it make sense to test also for non ASCII UTF-8 values? JSON is UTF-8, hence it should be supported.

Same is true for the other places where ASCII encoding is happening.

Line:348, pytests/viewquerytests.py -> PEP 8 style is to suffix (not prefix) variable names with an underscore if you want to use a name that is already in use/a keyword.

Line:354, pytests/viewquerytests.py -> Comment seems to be out-dated. num_docs is passed in.

Line:361, pytests/viewquerytests.py -> Should probably be

if(doc.age !== undefined)

-------------------------------------
author: Titus Ho
date: 2012-02-11 00:22:10.306000000

Patch Set 2: (5 inline comments)



Line:228, pytests/viewquerytests.py -> good pt

Line:335, pytests/viewquerytests.py -> sort of borrowed this from ViewBaseTest,   using utf-8

Line:348, pytests/viewquerytests.py -> fixed

Line:354, pytests/viewquerytests.py -> Removed, it's vague...num_docs is inherited from ViewBaseTests because it's a parameterized value.

Line:361, pytests/viewquerytests.py -> yep

-------------------------------------
