On Jan 27, 2012, at 02:37 , [email protected] wrote: > COUCHDB-1338 - run js tests with port=0 > > When the JS tests POST to /_restart, the server comes back up on a > different port. To work around this, add a getter property for the > CouchHTTP.prototype.base_url property, using a reserved slot on the > object to store the value. > > > Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/d20e7926 > Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/d20e7926 > Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/d20e7926 > > Branch: refs/heads/master > Commit: d20e792617db738dd5ad0e046ae847cd740f586f > Parents: 257eb52 > Author: Randall Leeds <[email protected]> > Authored: Sat Jan 7 14:21:29 2012 -0800 > Committer: Randall Leeds <[email protected]> > Committed: Thu Jan 26 17:03:10 2012 -0800 > > ---------------------------------------------------------------------- > src/couchdb/priv/couch_js/help.h | 2 + > src/couchdb/priv/couch_js/http.c | 60 +++++++++++++++++++++++++++++++- > src/couchdb/priv/couch_js/http.h | 3 ++ > src/couchdb/priv/couch_js/sm170.c | 8 ++++ > src/couchdb/priv/couch_js/sm180.c | 8 ++++ > src/couchdb/priv/couch_js/sm185.c | 8 ++++ > src/couchdb/priv/couch_js/util.c | 3 +- > src/couchdb/priv/couch_js/util.h | 2 + > test/Makefile.am | 1 + > test/etap/Makefile.am | 1 - > test/etap/random_port.ini | 19 ---------- > test/etap/test_util.erl.in | 2 +- > test/javascript/Makefile.am | 1 + > test/javascript/couch_http.js | 9 ++--- > test/javascript/run.tpl | 9 ++++- > test/random_port.ini | 19 ++++++++++ > 16 files changed, 125 insertions(+), 30 deletions(-) > ---------------------------------------------------------------------- > > > [...] > http://git-wip-us.apache.org/repos/asf/couchdb/blob/d20e7926/test/javascript/run.tpl > ---------------------------------------------------------------------- > diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl > index 47d2f6e..ac78b50 100644 > --- a/test/javascript/run.tpl > +++ b/test/javascript/run.tpl > @@ -17,6 +17,7 @@ SCRIPT_DIR=$SRC_DIR/share/www/script > JS_TEST_DIR=$SRC_DIR/test/javascript > > COUCHJS=%abs_top_builddir%/src/couchdb/priv/couchjs > +COUCH_URI_FILE=%localstaterundir%/couch.uri > > if [ "$#" -eq 0 ]; > then > @@ -48,11 +49,15 @@ abort() { > if [ -z $COUCHDB_NO_START ]; then > make dev > trap 'abort' 0 1 2 3 4 6 8 15 > - ./utils/run -b -r 1 > + ./utils/run -b -r 1 -n \ > + -a $SRC_DIR/etc/couchdb/default_dev.ini \ > + -a $SRC_DIR/test/random_port.ini \ > + -a $SRC_DIR/etc/couchdb/local_dev.ini
Randall, this breaks vpath builds. removing the -n option and the -n lines makes it work for me. To reproduce, just run make distcheck on master. Inside of make distcheck, we'll run make check on a vpath which in turn calls make dev and utils/run in ./test/javascript/run. $SRC_DIR now points to _build/../ instead of of just ./ and thus makes things fail (I think). Either way, removing these lines makes make distcheck work for me. What were the reasons for adding these in the first place? Maybe I've gotten in all wrong, but this holds us from getting make distcheck run on the various CI systems :) Cheers Jan -- > sleep 1 # give it a sec > fi > > -$COUCHJS -H \ > +# start the tests > +$COUCHJS -H -u $COUCH_URI_FILE \ > $SCRIPT_DIR/json2.js \ > $SCRIPT_DIR/sha1.js \ > $SCRIPT_DIR/oauth.js \ >
