You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Jan Lehnardt <ja...@apache.org> on 2014/02/17 11:14:40 UTC

Query Server Tests

Hi all,

I spent my Sunday hack time on extracting our rather hidden and little-exercised query server tests (https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb) into a standalone project as well as porting it to node, to finally get rid of our Ruby dependency there.

I’ve only got the basic framework and two tests ported yet, but it should be all set up to be filled in with the rest of the tests. Any help on the legwork there would be appreciated :)

The basic idea is that we a) shed the tests for the erlang query server, as we should move them into the etap tests and b) make this a custom project, so other query-server implementations have an easier time testing. I hope we can maintain this at the ASF git as the `couchdb-test-couchjs` repo (bikesheds welcome).

The project is here: https://github.com/janl/couchdb-test-couchjs

Tests are written like this: https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js

If you like to help and get stuck, let me know, I’m happy to help and I’d love some help on this :)

Hope you like this!

Best
Jan
-- 


Re: Query Server Tests

Posted by Jan Lehnardt <ja...@apache.org>.
On 24 Feb 2014, at 10:59 , Andy Wenk <an...@nms.de> wrote:

> Jan ... awesome!
> 
> Just to be able to understand this clearly: will it always be used
> standalone or did you integrate it into the CouchDB src in some way?

Thanks for the reminder, Andy, I realised I should explain my plans
a bit more :D

The idea is to have this to replace view_server/query_server_spec.rb
that isn’t really used these days and make it par of our normal
test suite run.

Going forward, I hope this helps other query server implementations
to get developed more reliably (most notably the node query server,
for now).

Also, by breaking this out, I believe it will be easier to start
working on a new query server protocol.

Best
Jan
--



> 
> Cheers
> 
> Andy
> 
> 
> On 24 February 2014 01:01, Jan Lehnardt <ja...@apache.org> wrote:
> 
>> Update:
>> 
>> I’m done porting all the JS tests now and they all pass.
>> 
>> Writing new compatible JS query servers should be easier now.
>> 
>> There is some code cleanup that I want to do at some point, but this is
>> good to be used.
>> 
>> Best
>> Jan
>> --
>> 
>> On 17 Feb 2014, at 11:43 , Jan Lehnardt <ja...@apache.org> wrote:
>> 
>>> 
>>> On 17 Feb 2014, at 11:26 , Alexander Shorin <kx...@gmail.com> wrote:
>>> 
>>>> Hi Jan.
>>>> 
>>>> This is good idea, but I think the implementation should be different.
>>>> 
>>>> What's the main problem of Ruby's tests? It isn't reusable. You cannot
>>>> use it for testing brand new query server done in language X. You'll
>>>> have to rewrite it completely. That's boring and counter productive.
>>>> 
>>>> Instead of this, we could just provide JSON test files: input and
>>>> output. The work flow for every query server will be trivial: clone
>>>> repo with test files, read the input.json send it to query server
>>>> expect the output.json. That's is. And we're all will be sure that
>>>> every query server in the world shares same behaviour for every cases
>>>> and especially for edge ones.
>>> 
>>> I did this mainly to encourage more people to fix up the Node query
>>> server. I’m happy to think about how to turn this into a more general
>>> query server testing framework once we’ve got that, until then, you
>>> are still welcome to do so, but I’ll focus on something that I know
>>> I could finish (some help would still be nice though :).
>>> 
>>> Best
>>> Jan
>>> --
>>> 
>>> 
>>> 
>>>> 
>>>> 
>>>> --
>>>> ,,,^..^,,,
>>>> 
>>>> 
>>>> On Mon, Feb 17, 2014 at 2:14 PM, Jan Lehnardt <ja...@apache.org> wrote:
>>>>> Hi all,
>>>>> 
>>>>> I spent my Sunday hack time on extracting our rather hidden and
>> little-exercised query server tests (
>> https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb)
>> into a standalone project as well as porting it to node, to finally get rid
>> of our Ruby dependency there.
>>>>> 
>>>>> I’ve only got the basic framework and two tests ported yet, but it
>> should be all set up to be filled in with the rest of the tests. Any help
>> on the legwork there would be appreciated :)
>>>>> 
>>>>> The basic idea is that we a) shed the tests for the erlang query
>> server, as we should move them into the etap tests and b) make this a
>> custom project, so other query-server implementations have an easier time
>> testing. I hope we can maintain this at the ASF git as the
>> `couchdb-test-couchjs` repo (bikesheds welcome).
>>>>> 
>>>>> The project is here: https://github.com/janl/couchdb-test-couchjs
>>>>> 
>>>>> Tests are written like this:
>> https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js
>>>>> 
>>>>> If you like to help and get stuck, let me know, I’m happy to help and
>> I’d love some help on this :)
>>>>> 
>>>>> Hope you like this!
>>>>> 
>>>>> Best
>>>>> Jan
>>>>> --
>> 
>> 
> 
> 
> -- 
> Andy Wenk
> Hamburg - Germany
> RockIt!
> 
> http://www.couchdb-buch.de
> http://www.pg-praxisbuch.de
> 
> GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588
> 
> https://people.apache.org/keys/committer/andywenk.asc


Re: Query Server Tests

Posted by Andy Wenk <an...@nms.de>.
Jan ... awesome!

Just to be able to understand this clearly: will it always be used
standalone or did you integrate it into the CouchDB src in some way?

Cheers

Andy


On 24 February 2014 01:01, Jan Lehnardt <ja...@apache.org> wrote:

> Update:
>
> I’m done porting all the JS tests now and they all pass.
>
> Writing new compatible JS query servers should be easier now.
>
> There is some code cleanup that I want to do at some point, but this is
> good to be used.
>
> Best
> Jan
> --
>
> On 17 Feb 2014, at 11:43 , Jan Lehnardt <ja...@apache.org> wrote:
>
> >
> > On 17 Feb 2014, at 11:26 , Alexander Shorin <kx...@gmail.com> wrote:
> >
> >> Hi Jan.
> >>
> >> This is good idea, but I think the implementation should be different.
> >>
> >> What's the main problem of Ruby's tests? It isn't reusable. You cannot
> >> use it for testing brand new query server done in language X. You'll
> >> have to rewrite it completely. That's boring and counter productive.
> >>
> >> Instead of this, we could just provide JSON test files: input and
> >> output. The work flow for every query server will be trivial: clone
> >> repo with test files, read the input.json send it to query server
> >> expect the output.json. That's is. And we're all will be sure that
> >> every query server in the world shares same behaviour for every cases
> >> and especially for edge ones.
> >
> > I did this mainly to encourage more people to fix up the Node query
> > server. I’m happy to think about how to turn this into a more general
> > query server testing framework once we’ve got that, until then, you
> > are still welcome to do so, but I’ll focus on something that I know
> > I could finish (some help would still be nice though :).
> >
> > Best
> > Jan
> > --
> >
> >
> >
> >>
> >>
> >> --
> >> ,,,^..^,,,
> >>
> >>
> >> On Mon, Feb 17, 2014 at 2:14 PM, Jan Lehnardt <ja...@apache.org> wrote:
> >>> Hi all,
> >>>
> >>> I spent my Sunday hack time on extracting our rather hidden and
> little-exercised query server tests (
> https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb)
> into a standalone project as well as porting it to node, to finally get rid
> of our Ruby dependency there.
> >>>
> >>> I’ve only got the basic framework and two tests ported yet, but it
> should be all set up to be filled in with the rest of the tests. Any help
> on the legwork there would be appreciated :)
> >>>
> >>> The basic idea is that we a) shed the tests for the erlang query
> server, as we should move them into the etap tests and b) make this a
> custom project, so other query-server implementations have an easier time
> testing. I hope we can maintain this at the ASF git as the
> `couchdb-test-couchjs` repo (bikesheds welcome).
> >>>
> >>> The project is here: https://github.com/janl/couchdb-test-couchjs
> >>>
> >>> Tests are written like this:
> https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js
> >>>
> >>> If you like to help and get stuck, let me know, I’m happy to help and
> I’d love some help on this :)
> >>>
> >>> Hope you like this!
> >>>
> >>> Best
> >>> Jan
> >>> --
>
>


-- 
Andy Wenk
Hamburg - Germany
RockIt!

http://www.couchdb-buch.de
http://www.pg-praxisbuch.de

GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588

https://people.apache.org/keys/committer/andywenk.asc

Re: Query Server Tests

Posted by Jan Lehnardt <ja...@apache.org>.
Update:

I’m done porting all the JS tests now and they all pass.

Writing new compatible JS query servers should be easier now.

There is some code cleanup that I want to do at some point, but this is good to be used.

Best
Jan
-- 

On 17 Feb 2014, at 11:43 , Jan Lehnardt <ja...@apache.org> wrote:

> 
> On 17 Feb 2014, at 11:26 , Alexander Shorin <kx...@gmail.com> wrote:
> 
>> Hi Jan.
>> 
>> This is good idea, but I think the implementation should be different.
>> 
>> What's the main problem of Ruby's tests? It isn't reusable. You cannot
>> use it for testing brand new query server done in language X. You'll
>> have to rewrite it completely. That's boring and counter productive.
>> 
>> Instead of this, we could just provide JSON test files: input and
>> output. The work flow for every query server will be trivial: clone
>> repo with test files, read the input.json send it to query server
>> expect the output.json. That's is. And we're all will be sure that
>> every query server in the world shares same behaviour for every cases
>> and especially for edge ones.
> 
> I did this mainly to encourage more people to fix up the Node query
> server. I’m happy to think about how to turn this into a more general
> query server testing framework once we’ve got that, until then, you
> are still welcome to do so, but I’ll focus on something that I know
> I could finish (some help would still be nice though :).
> 
> Best
> Jan
> -- 
> 
> 
> 
>> 
>> 
>> --
>> ,,,^..^,,,
>> 
>> 
>> On Mon, Feb 17, 2014 at 2:14 PM, Jan Lehnardt <ja...@apache.org> wrote:
>>> Hi all,
>>> 
>>> I spent my Sunday hack time on extracting our rather hidden and little-exercised query server tests (https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb) into a standalone project as well as porting it to node, to finally get rid of our Ruby dependency there.
>>> 
>>> I’ve only got the basic framework and two tests ported yet, but it should be all set up to be filled in with the rest of the tests. Any help on the legwork there would be appreciated :)
>>> 
>>> The basic idea is that we a) shed the tests for the erlang query server, as we should move them into the etap tests and b) make this a custom project, so other query-server implementations have an easier time testing. I hope we can maintain this at the ASF git as the `couchdb-test-couchjs` repo (bikesheds welcome).
>>> 
>>> The project is here: https://github.com/janl/couchdb-test-couchjs
>>> 
>>> Tests are written like this: https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js
>>> 
>>> If you like to help and get stuck, let me know, I’m happy to help and I’d love some help on this :)
>>> 
>>> Hope you like this!
>>> 
>>> Best
>>> Jan
>>> --


Re: Query Server Tests

Posted by Jan Lehnardt <ja...@apache.org>.
On 17 Feb 2014, at 11:26 , Alexander Shorin <kx...@gmail.com> wrote:

> Hi Jan.
> 
> This is good idea, but I think the implementation should be different.
> 
> What's the main problem of Ruby's tests? It isn't reusable. You cannot
> use it for testing brand new query server done in language X. You'll
> have to rewrite it completely. That's boring and counter productive.
> 
> Instead of this, we could just provide JSON test files: input and
> output. The work flow for every query server will be trivial: clone
> repo with test files, read the input.json send it to query server
> expect the output.json. That's is. And we're all will be sure that
> every query server in the world shares same behaviour for every cases
> and especially for edge ones.

I did this mainly to encourage more people to fix up the Node query
server. I’m happy to think about how to turn this into a more general
query server testing framework once we’ve got that, until then, you
are still welcome to do so, but I’ll focus on something that I know
I could finish (some help would still be nice though :).

Best
Jan
-- 



> 
> 
> --
> ,,,^..^,,,
> 
> 
> On Mon, Feb 17, 2014 at 2:14 PM, Jan Lehnardt <ja...@apache.org> wrote:
>> Hi all,
>> 
>> I spent my Sunday hack time on extracting our rather hidden and little-exercised query server tests (https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb) into a standalone project as well as porting it to node, to finally get rid of our Ruby dependency there.
>> 
>> I’ve only got the basic framework and two tests ported yet, but it should be all set up to be filled in with the rest of the tests. Any help on the legwork there would be appreciated :)
>> 
>> The basic idea is that we a) shed the tests for the erlang query server, as we should move them into the etap tests and b) make this a custom project, so other query-server implementations have an easier time testing. I hope we can maintain this at the ASF git as the `couchdb-test-couchjs` repo (bikesheds welcome).
>> 
>> The project is here: https://github.com/janl/couchdb-test-couchjs
>> 
>> Tests are written like this: https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js
>> 
>> If you like to help and get stuck, let me know, I’m happy to help and I’d love some help on this :)
>> 
>> Hope you like this!
>> 
>> Best
>> Jan
>> --
>> 


Re: Query Server Tests

Posted by Alexander Shorin <kx...@gmail.com>.
Hi Jan.

This is good idea, but I think the implementation should be different.

What's the main problem of Ruby's tests? It isn't reusable. You cannot
use it for testing brand new query server done in language X. You'll
have to rewrite it completely. That's boring and counter productive.

Instead of this, we could just provide JSON test files: input and
output. The work flow for every query server will be trivial: clone
repo with test files, read the input.json send it to query server
expect the output.json. That's is. And we're all will be sure that
every query server in the world shares same behaviour for every cases
and especially for edge ones.


--
,,,^..^,,,


On Mon, Feb 17, 2014 at 2:14 PM, Jan Lehnardt <ja...@apache.org> wrote:
> Hi all,
>
> I spent my Sunday hack time on extracting our rather hidden and little-exercised query server tests (https://github.com/apache/couchdb/blob/master/test/view_server/query_server_spec.rb) into a standalone project as well as porting it to node, to finally get rid of our Ruby dependency there.
>
> I’ve only got the basic framework and two tests ported yet, but it should be all set up to be filled in with the rest of the tests. Any help on the legwork there would be appreciated :)
>
> The basic idea is that we a) shed the tests for the erlang query server, as we should move them into the etap tests and b) make this a custom project, so other query-server implementations have an easier time testing. I hope we can maintain this at the ASF git as the `couchdb-test-couchjs` repo (bikesheds welcome).
>
> The project is here: https://github.com/janl/couchdb-test-couchjs
>
> Tests are written like this: https://github.com/janl/couchdb-test-couchjs/blob/master/lib/tests/map.js
>
> If you like to help and get stuck, let me know, I’m happy to help and I’d love some help on this :)
>
> Hope you like this!
>
> Best
> Jan
> --
>