DESCRIPTION

CBQE-436: Backport view merge couchdb js tests to testrunner

Change-Id: Iaaa7818aee391c5a81c7c8d7f70b7e84049b4d55


COMMENTS

author: Trevor Santana
date: 2012-08-07 21:50:56.264000000

Uploaded patch set 5.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:16.003000000

Patch Set 5: I would prefer that you didn't submit this

(10 inline comments)

Great work, we are close. Some things are still left, but the majority is just minor stylistic comments, which I thought I add, as you need to rework the patch anyway.

-------------------------------------
author: Trevor Santana
date: 2012-08-09 18:48:15.131000000

Patch Set 5: (1 inline comment)



Line:74, pytests/viewmergetests.py -> The thing is that in setup nodes are rebalanced, bucket is created, it will take time(Filipe's requirement is that tests should pass quickly), so i just do it for the first test, and do clean up for the last test

Based on that I cannot add items in setup because we have tests for empty bucket

-------------------------------------
author: Trevor Santana
date: 2012-08-09 18:54:02.408000000

Patch Set 5: (1 inline comment)



Line:193, pytests/viewmergetests.py -> verify_keys_are_sorted function verifies that keys are sorted only, no additional verifications will be performed. Query with 'keys' param should not be sorted

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:40, conf/py-viewmerge.conf -> Those to tests need to run at the end of the test suite as they add docs that would make other tests fail.

I would add a comment like:

    # Keep those two tests at the end of the file, else any following tests would fail
    # as they add new values to the vBuckets.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:8, pytests/viewmergetests.py -> There should be an empty line here (between imports from Python Standard libs and the local ones should always be an empty line according to PEP-8).

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:20, pytests/viewmergetests.py -> There should be an additional empty line before `class`.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:68, pytests/viewmergetests.py -> This looks like some leftover from debugging. Can it be removed?

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:74, pytests/viewmergetests.py -> I think it would make more sense to populate the vbuckets on setup if first_case is true. This way you can run a single tests with testrunner when setting first_case and last_case, e.g.:

./testrunner -i b/resources/dev-4-nodes.ini -t viewmergetests.ViewMergingTests.test_keys,first_case=true,last_case=true

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:92, pytests/viewmergetests.py -> you don't need to do 'params=xxx' any longer, you can just pass in the value directly. This is true for all occurrences.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:193, pytests/viewmergetests.py -> Please add an "else"-case when 'keys' is given. There all individual keys should be verified. I think the easiest way is to make a `set()` of the keys in `params` and a set of the resulting keys and check if both sets are the same (resp. the intersection is empty). sets are way faster than looping through both lists and check if the keys are in both.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:223, pytests/viewmergetests.py -> Don't we need to take self.is_dev_view into account here (and 5 lines below)?

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:230, pytests/viewmergetests.py -> What is this `sleep` for? To wait until the docs are persisted? If that's the case I would use the `wait_for_persistence()` from the `RebalanceHelper` instead.

Given the comment on line 74, you can call the `create_ddocs()` function before the `populate_*` call, which does already wait for the persistence.

-------------------------------------
author: Ayla Reynolds
date: 2012-08-09 13:09:15.975000000

MISMATCHED INLINE COMMENT
Line:314, pytests/viewmergetests.py -> `view_name` doesn't need to have '' as default value, it can just be `view_name`.

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