You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2011/10/31 09:41:45 UTC

Re: git commit: Start/Stop CouchDB aronud JS CLI tests.

On Mon, Oct 31, 2011 at 9:37 AM,  <ja...@apache.org> wrote:
> Updated Branches:
>  refs/heads/master 31edafecb -> 6dcd3a4b6
>
>
> Start/Stop CouchDB aronud JS CLI tests.
>
>
> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6dcd3a4b
> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6dcd3a4b
> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6dcd3a4b
>
> Branch: refs/heads/master
> Commit: 6dcd3a4b635f012b4fab697fbc990de70eb9840d
> Parents: 31edafe
> Author: Jan Lehnardt <ja...@apache.org>
> Authored: Mon Oct 31 09:37:48 2011 +0100
> Committer: Jan Lehnardt <ja...@apache.org>
> Committed: Mon Oct 31 09:37:48 2011 +0100
>
> ----------------------------------------------------------------------
>  test/javascript/run.tpl |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6dcd3a4b/test/javascript/run.tpl
> ----------------------------------------------------------------------
> diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl
> index e4a2029..eb73a61 100644
> --- a/test/javascript/run.tpl
> +++ b/test/javascript/run.tpl
> @@ -35,6 +35,11 @@ else
>     fi
>  fi
>
> +make dev
> +# start CouchDB
> +./utils/run -b -r 1
> +sleep 1 # give it a sec
> +
>  cat $SCRIPT_DIR/json2.js \
>        $SCRIPT_DIR/sha1.js \
>        $SCRIPT_DIR/oauth.js \
> @@ -45,3 +50,6 @@ cat $SCRIPT_DIR/json2.js \
>        $JS_TEST_DIR/couch_http.js \
>        $JS_TEST_DIR/cli_runner.js \
>     | $COUCHJS -H -
> +
> +# stop CouchDB
> +./utils/run -d
>
>

wouldn't it better if we pass an ini with port=0 ? To make sure tests
can be run?

- benoit

Re: git commit: Start/Stop CouchDB aronud JS CLI tests.

Posted by Jan Lehnardt <ja...@apache.org>.
On Oct 31, 2011, at 09:41 , Benoit Chesneau wrote:

> On Mon, Oct 31, 2011 at 9:37 AM,  <ja...@apache.org> wrote:
>> Updated Branches:
>>  refs/heads/master 31edafecb -> 6dcd3a4b6
>> 
>> 
>> Start/Stop CouchDB aronud JS CLI tests.
>> 
>> 
>> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6dcd3a4b
>> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6dcd3a4b
>> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6dcd3a4b
>> 
>> Branch: refs/heads/master
>> Commit: 6dcd3a4b635f012b4fab697fbc990de70eb9840d
>> Parents: 31edafe
>> Author: Jan Lehnardt <ja...@apache.org>
>> Authored: Mon Oct 31 09:37:48 2011 +0100
>> Committer: Jan Lehnardt <ja...@apache.org>
>> Committed: Mon Oct 31 09:37:48 2011 +0100
>> 
>> ----------------------------------------------------------------------
>>  test/javascript/run.tpl |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6dcd3a4b/test/javascript/run.tpl
>> ----------------------------------------------------------------------
>> diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl
>> index e4a2029..eb73a61 100644
>> --- a/test/javascript/run.tpl
>> +++ b/test/javascript/run.tpl
>> @@ -35,6 +35,11 @@ else
>>     fi
>>  fi
>> 
>> +make dev
>> +# start CouchDB
>> +./utils/run -b -r 1
>> +sleep 1 # give it a sec
>> +
>>  cat $SCRIPT_DIR/json2.js \
>>        $SCRIPT_DIR/sha1.js \
>>        $SCRIPT_DIR/oauth.js \
>> @@ -45,3 +50,6 @@ cat $SCRIPT_DIR/json2.js \
>>        $JS_TEST_DIR/couch_http.js \
>>        $JS_TEST_DIR/cli_runner.js \
>>     | $COUCHJS -H -
>> +
>> +# stop CouchDB
>> +./utils/run -d
>> 
>> 
> 
> wouldn't it better if we pass an ini with port=0 ? To make sure tests
> can be run?

Currently tests are hardcoded with 5984, but I wouldn't object to fixing that :) The two places to fix this are:

  test/javascript/couch_http.js: CouchHTTP.prototype.base_url = "http://127.0.0.1:5984"

and

  src/couchdb/priv/couch_js/http.c: curl_easy_setopt(HTTP_HANDLE, CURLOPT_REFERER, "http://127.0.0.1:5984/");

Cheers
Jan
--