test: run_tests.sh should just assume 8050 and 8051 (#1315)

Right now run_tests.sh assumes it has 8053 and 9991 without causing any
problems.  Start assuming we have 8050 and 8051 as well instead of
requiring people to pass them in.
This commit is contained in:
Jeff Kaufman
2016-11-03 14:58:05 -04:00
committed by GitHub
parent 17e4162334
commit 97134d951e
4 changed files with 18 additions and 19 deletions
+1 -2
View File
@@ -51,8 +51,7 @@ install:
script: script:
- echo "build successful" - echo "build successful"
- echo "cd ~/ngxpagespeed" - echo "cd ~/ngxpagespeed"
- echo "sudo ./test/run_tests.sh 8050 8051 $HOME/mod_pagespeed/src $HOME/nginx-branches-default/objs selfsigned.modpagespeed.com" - echo "sudo ./test/run_tests.sh $HOME/mod_pagespeed $HOME/nginx-branches-default/objs/nginx"
- echo "sudo ./test/run_tests.sh 8050 8051 $HOME/mod_pagespeed $HOME/nginx-branches-default/objs/nginx selfsigned.modpagespeed.com"
sudo: required sudo: required
compiler: compiler:
- gcc - gcc
+1 -1
View File
@@ -1184,7 +1184,7 @@ OUT=$($WGET_DUMP --header=Host:response-header-disable.example.com $URL)
check_not_from "$OUT" egrep -qi 'addInstrumentationInit' check_not_from "$OUT" egrep -qi 'addInstrumentationInit'
# TODO(jmaessen, jefftk): Port proxying tests, which rely on pointing a # TODO(jmaessen, jefftk): Port proxying tests, which rely on pointing a
# MapProxyDomain construct at a static server. Perhaps localhost:8050 will # MapProxyDomain construct at a static server. Perhaps $HOSTNAME will
# serve, but the tests need to use different urls then. For mod_pagespeed these # serve, but the tests need to use different urls then. For mod_pagespeed these
# tests immediately precede the "scrape_secondary_stat" definition in # tests immediately precede the "scrape_secondary_stat" definition in
# system_test.sh. # system_test.sh.
+1 -1
View File
@@ -232,7 +232,7 @@ http {
# Block 6: Location block with proxy_cache directives. # Block 6: Location block with proxy_cache directives.
location /mod_pagespeed_test/cachable_rewritten_html/ { location /mod_pagespeed_test/cachable_rewritten_html/ {
# 1: Upstream PageSpeed server is running at localhost:8050. # 1: Upstream PageSpeed server is running at localhost:@@PRIMARY_PORT@@.
proxy_pass http://localhost:@@PRIMARY_PORT@@; proxy_pass http://localhost:@@PRIMARY_PORT@@;
# 2: Use htmlcache as the zone for caching. # 2: Use htmlcache as the zone for caching.
proxy_cache htmlcache; proxy_cache htmlcache;
+15 -15
View File
@@ -23,12 +23,12 @@
# Exits with status 2 if command line args are wrong. # Exits with status 2 if command line args are wrong.
# #
# Usage: # Usage:
# ./run_tests.sh primary_port secondary_port mod_pagespeed_dir ngx_binary # ./run_tests.sh /path/to/mod_pagespeed /path/to/nginx/binary
# pagespeed_test_host
# Example:
# ./run_tests.sh 8050 8051 /path/to/mod_pagespeed /path/to/nginx/binary
# selfsigned.modpagespeed.com
# #
# By default the test script uses several ports. If you have a port conflict
# and need to override one you can do that by setting the relevant environment
# variable. For example:
# PRIMARY_PORT=1234 ./run_tests.sh /.../mod_pagespeed /.../nginx/binary
# Normally we test only with the native fetcher off. Set # Normally we test only with the native fetcher off. Set
# TEST_NATIVE_FETCHER=true to also test the native fetcher, set # TEST_NATIVE_FETCHER=true to also test the native fetcher, set
@@ -45,19 +45,19 @@ RUN_TESTS=${RUN_TESTS:-true}
# true. # true.
USE_VALGRIND=${USE_VALGRIND:-false} USE_VALGRIND=${USE_VALGRIND:-false}
if [ "$#" -ne 5 ] ; then if [ "$#" -ne 2 ] ; then
echo "Usage: $0 primary_port secondary_port mod_pagespeed_dir" echo "Usage: $0 mod_pagespeed_dir nginx_executable"
echo " nginx_executable"
exit 2 exit 2
fi fi
PRIMARY_PORT="$1" MOD_PAGESPEED_DIR="$1"
SECONDARY_PORT="$2" NGINX_EXECUTABLE="$2"
MOD_PAGESPEED_DIR="$3"
NGINX_EXECUTABLE="$4" : ${PRIMARY_PORT:=8050}
PAGESPEED_TEST_HOST="$5" : ${SECONDARY_PORT:=8051}
CONTROLLER_PORT=8053 : ${CONTROLLER_PORT:=8053}
RCPORT=9991 : ${RCPORT:=9991}
: ${PAGESPEED_TEST_HOST:=selfsigned.modpagespeed.com}
this_dir="$( cd $(dirname "$0") && pwd)" this_dir="$( cd $(dirname "$0") && pwd)"