From def177b7febd6f96eed31628144cba964f1bae77 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 25 Mar 2016 15:00:47 -0700 Subject: Don't set -ex for nvm functions --- test/distrib/node/run_distrib_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/distrib') diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh index 9b8f15771b..18b339399b 100755 --- a/test/distrib/node/run_distrib_test.sh +++ b/test/distrib/node/run_distrib_test.sh @@ -30,11 +30,11 @@ NODE_VERSION=$1 source ~/.nvm/nvm.sh -set -ex cd $(dirname $0) nvm install $NODE_VERSION +set -ex npm install -g node-static -- cgit v1.2.3 From f22f4c60bad22746b4e76928f82a3e35872f63e6 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 25 Mar 2016 15:52:42 -0700 Subject: Node distrib test: don't start all static servers on the same port --- test/distrib/node/run_distrib_test.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test/distrib') diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh index 18b339399b..e9183a203b 100755 --- a/test/distrib/node/run_distrib_test.sh +++ b/test/distrib/node/run_distrib_test.sh @@ -38,13 +38,10 @@ set -ex npm install -g node-static -# Kill off existing static servers -kill -9 $(ps aux | grep '[n]ode .*static' | awk '{print $2}') || true - STATIC_SERVER=127.0.0.1 -STATIC_PORT=8080 +STATIC_PORT=$$ -# Serves the input_artifacts directory statically at localhost:8080 +# Serves the input_artifacts directory statically at localhost: static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT & STATIC_PID=$! -- cgit v1.2.3 From bebf2df6e4c2548ef53ec93a6339900ad3de61e5 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 28 Mar 2016 11:31:51 -0700 Subject: Make distribtest more robust, especially on Mac --- test/distrib/node/run_distrib_test.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'test/distrib') diff --git a/test/distrib/node/run_distrib_test.sh b/test/distrib/node/run_distrib_test.sh index e9183a203b..13a42fcb0a 100755 --- a/test/distrib/node/run_distrib_test.sh +++ b/test/distrib/node/run_distrib_test.sh @@ -28,6 +28,15 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +function finish() { + rv=$? + kill $STATIC_PID || true + curl "localhost:32767/drop/$STATIC_PORT" || true + exit $rv +} + +trap finish EXIT + NODE_VERSION=$1 source ~/.nvm/nvm.sh @@ -39,7 +48,9 @@ set -ex npm install -g node-static STATIC_SERVER=127.0.0.1 -STATIC_PORT=$$ +# If port_server is running, get port from that. Otherwise, assume we're in +# docker and use 8080 +STATIC_PORT=$(curl 'localhost:32767/get' || echo '8080') # Serves the input_artifacts directory statically at localhost: static "$EXTERNAL_GIT_ROOT/input_artifacts" -a $STATIC_SERVER -p $STATIC_PORT & @@ -49,6 +60,4 @@ STATIC_URL="http://$STATIC_SERVER:$STATIC_PORT/" npm install --unsafe-perm $STATIC_URL/grpc.tgz --grpc_node_binary_host_mirror=$STATIC_URL -kill -9 $STATIC_PID - ./distrib_test.js -- cgit v1.2.3