diff options
Diffstat (limited to 'tools/run_tests')
20 files changed, 92 insertions, 92 deletions
diff --git a/tools/run_tests/helper_scripts/build_csharp.sh b/tools/run_tests/helper_scripts/build_csharp.sh index ec0a441f56..c6bee82b44 100755 --- a/tools/run_tests/helper_scripts/build_csharp.sh +++ b/tools/run_tests/helper_scripts/build_csharp.sh @@ -15,12 +15,12 @@ set -ex -cd $(dirname $0)/../../../src/csharp +cd "$(dirname "$0")/../../../src/csharp" if [ "$CONFIG" == "gcov" ] then # overriding NativeDependenciesConfigurationUnix makes C# project pick up the gcov flavor of grpc_csharp_ext - dotnet build --configuration $MSBUILD_CONFIG /p:NativeDependenciesConfigurationUnix=gcov Grpc.sln + dotnet build --configuration "$MSBUILD_CONFIG" /p:NativeDependenciesConfigurationUnix=gcov Grpc.sln else - dotnet build --configuration $MSBUILD_CONFIG Grpc.sln + dotnet build --configuration "$MSBUILD_CONFIG" Grpc.sln fi diff --git a/tools/run_tests/helper_scripts/build_php.sh b/tools/run_tests/helper_scripts/build_php.sh index 856e5b6865..443be34fa0 100755 --- a/tools/run_tests/helper_scripts/build_php.sh +++ b/tools/run_tests/helper_scripts/build_php.sh @@ -18,9 +18,9 @@ set -ex CONFIG=${CONFIG:-opt} # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." -root=`pwd` +root=$(pwd) export GRPC_LIB_SUBDIR=libs/$CONFIG export CFLAGS="-Wno-parentheses-equality" @@ -30,8 +30,8 @@ cd src/php cd ext/grpc phpize if [ "$CONFIG" != "gcov" ] ; then - ./configure --enable-grpc=$root + ./configure --enable-grpc="$root" else - ./configure --enable-grpc=$root --enable-coverage + ./configure --enable-grpc="$root" --enable-coverage fi make diff --git a/tools/run_tests/helper_scripts/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh index e3620821f3..b809fe012f 100755 --- a/tools/run_tests/helper_scripts/build_python.sh +++ b/tools/run_tests/helper_scripts/build_python.sh @@ -16,13 +16,13 @@ set -ex # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." ########################## # Portability operations # ########################## -PLATFORM=`uname -s` +PLATFORM=$(uname -s) function is_msys() { if [ "${PLATFORM/MSYS}" != "$PLATFORM" ]; then @@ -64,7 +64,7 @@ function venv() { # Path to python executable within a virtual environment depending on the # system. function venv_relative_python() { - if [ $(is_mingw) ]; then + if [ "$(is_mingw)" ]; then echo 'Scripts/python.exe' else echo 'bin/python' @@ -73,7 +73,7 @@ function venv_relative_python() { # Distutils toolchain to use depending on the system. function toolchain() { - if [ $(is_mingw) ]; then + if [ "$(is_mingw)" ]; then echo 'mingw32' else echo 'unix' @@ -97,17 +97,17 @@ function script_realpath() { #################### PYTHON=${1:-python2.7} -VENV=${2:-$(venv $PYTHON)} +VENV=${2:-$(venv "$PYTHON")} VENV_RELATIVE_PYTHON=${3:-$(venv_relative_python)} TOOLCHAIN=${4:-$(toolchain)} -if [ $(is_msys) ]; then +if [ "$(is_msys)" ]; then echo "MSYS doesn't directly provide the right compiler(s);" echo "switch to a MinGW shell." exit 1 fi -ROOT=`pwd` +ROOT=$(pwd) export CFLAGS="-I$ROOT/include -std=gnu99 -fno-wrapv $CFLAGS" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export LANG=en_US.UTF-8 @@ -117,7 +117,7 @@ export LANG=en_US.UTF-8 HOST_PYTHON=${HOST_PYTHON:-python} # If ccache is available on Linux, use it. -if [ $(is_linux) ]; then +if [ "$(is_linux)" ]; then # We're not on Darwin (Mac OS X) if [ -x "$(command -v ccache)" ]; then if [ -x "$(command -v gcc)" ]; then @@ -137,46 +137,46 @@ fi # it's possible that the virtualenv is still usable and we trust the tester to # be able to 'figure it out' instead of us e.g. doing potentially expensive and # unnecessary error recovery by `rm -rf`ing the virtualenv. -($PYTHON -m virtualenv $VENV || - $HOST_PYTHON -m virtualenv -p $PYTHON $VENV || +($PYTHON -m virtualenv "$VENV" || + $HOST_PYTHON -m virtualenv -p "$PYTHON" "$VENV" || true) -VENV_PYTHON=`script_realpath "$VENV/$VENV_RELATIVE_PYTHON"` +VENV_PYTHON=$(script_realpath "$VENV/$VENV_RELATIVE_PYTHON") # pip-installs the directory specified. Used because on MSYS the vanilla Windows # Python gets confused when parsing paths. pip_install_dir() { - PWD=`pwd` - cd $1 - ($VENV_PYTHON setup.py build_ext -c $TOOLCHAIN || true) + PWD=$(pwd) + cd "$1" + ($VENV_PYTHON setup.py build_ext -c "$TOOLCHAIN" || true) $VENV_PYTHON -m pip install --no-deps . - cd $PWD + cd "$PWD" } $VENV_PYTHON -m pip install --upgrade pip==9.0.1 $VENV_PYTHON -m pip install setuptools $VENV_PYTHON -m pip install cython $VENV_PYTHON -m pip install six enum34 protobuf futures -pip_install_dir $ROOT +pip_install_dir "$ROOT" -$VENV_PYTHON $ROOT/tools/distrib/python/make_grpcio_tools.py -pip_install_dir $ROOT/tools/distrib/python/grpcio_tools +$VENV_PYTHON "$ROOT/tools/distrib/python/make_grpcio_tools.py" +pip_install_dir "$ROOT/tools/distrib/python/grpcio_tools" # Build/install health checking -$VENV_PYTHON $ROOT/src/python/grpcio_health_checking/setup.py preprocess -$VENV_PYTHON $ROOT/src/python/grpcio_health_checking/setup.py build_package_protos -pip_install_dir $ROOT/src/python/grpcio_health_checking +$VENV_PYTHON "$ROOT/src/python/grpcio_health_checking/setup.py" preprocess +$VENV_PYTHON "$ROOT/src/python/grpcio_health_checking/setup.py" build_package_protos +pip_install_dir "$ROOT/src/python/grpcio_health_checking" # Build/install reflection -$VENV_PYTHON $ROOT/src/python/grpcio_reflection/setup.py preprocess -$VENV_PYTHON $ROOT/src/python/grpcio_reflection/setup.py build_package_protos -pip_install_dir $ROOT/src/python/grpcio_reflection +$VENV_PYTHON "$ROOT/src/python/grpcio_reflection/setup.py" preprocess +$VENV_PYTHON "$ROOT/src/python/grpcio_reflection/setup.py" build_package_protos +pip_install_dir "$ROOT/src/python/grpcio_reflection" # Install testing -pip_install_dir $ROOT/src/python/grpcio_testing +pip_install_dir "$ROOT/src/python/grpcio_testing" # Build/install tests $VENV_PYTHON -m pip install coverage==4.4 oauth2client==4.1.0 \ google-auth==1.0.0 requests==2.14.2 -$VENV_PYTHON $ROOT/src/python/grpcio_tests/setup.py preprocess -$VENV_PYTHON $ROOT/src/python/grpcio_tests/setup.py build_package_protos -pip_install_dir $ROOT/src/python/grpcio_tests +$VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" preprocess +$VENV_PYTHON "$ROOT/src/python/grpcio_tests/setup.py" build_package_protos +pip_install_dir "$ROOT/src/python/grpcio_tests" diff --git a/tools/run_tests/helper_scripts/build_python_msys2.sh b/tools/run_tests/helper_scripts/build_python_msys2.sh index 4c54f1c472..f388b4bf96 100644 --- a/tools/run_tests/helper_scripts/build_python_msys2.sh +++ b/tools/run_tests/helper_scripts/build_python_msys2.sh @@ -15,7 +15,7 @@ set -ex -BUILD_PYTHON=`realpath "$(dirname $0)/build_python.sh"` +BUILD_PYTHON=$(realpath "$(dirname "$0")/build_python.sh") export MSYSTEM=$1 shift 1 -bash --login $BUILD_PYTHON "$@" +bash --login "$BUILD_PYTHON" "$@" diff --git a/tools/run_tests/helper_scripts/build_ruby.sh b/tools/run_tests/helper_scripts/build_ruby.sh index a9267e10f0..b15a8639d9 100755 --- a/tools/run_tests/helper_scripts/build_ruby.sh +++ b/tools/run_tests/helper_scripts/build_ruby.sh @@ -19,7 +19,7 @@ set -ex export GRPC_CONFIG=${CONFIG:-opt} # change to grpc's ruby directory -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." rm -rf ./tmp rake compile diff --git a/tools/run_tests/helper_scripts/bundle_install_wrapper.sh b/tools/run_tests/helper_scripts/bundle_install_wrapper.sh index 27b8fced7b..ab31dd5c80 100755 --- a/tools/run_tests/helper_scripts/bundle_install_wrapper.sh +++ b/tools/run_tests/helper_scripts/bundle_install_wrapper.sh @@ -17,9 +17,9 @@ set -ex # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." -SYSTEM=`uname | cut -f 1 -d_` +SYSTEM=$(uname | cut -f 1 -d_) if [ "$SYSTEM" == "Darwin" ] ; then # Workaround for crash during bundle install diff --git a/tools/run_tests/helper_scripts/post_tests_c.sh b/tools/run_tests/helper_scripts/post_tests_c.sh index a4a8f44dca..e4ab203543 100755 --- a/tools/run_tests/helper_scripts/post_tests_c.sh +++ b/tools/run_tests/helper_scripts/post_tests_c.sh @@ -17,14 +17,14 @@ set -ex if [ "$CONFIG" != "gcov" ] ; then exit ; fi -root=$(readlink -f $(dirname $0)/../../..) +root=$(readlink -f "$(dirname "$0")/../../..") out=$root/reports/c_cxx_coverage tmp1=$(mktemp) tmp2=$(mktemp) -cd $root -lcov --capture --directory . --output-file $tmp1 -lcov --extract $tmp1 "$root/src/*" "$root/include/*" --output-file $tmp2 -genhtml $tmp2 --output-directory $out -rm $tmp2 -rm $tmp1 +cd "$root" +lcov --capture --directory . --output-file "$tmp1" +lcov --extract "$tmp1" "$root/src/*" "$root/include/*" --output-file "$tmp2" +genhtml "$tmp2" --output-directory "$out" +rm "$tmp2" +rm "$tmp1" diff --git a/tools/run_tests/helper_scripts/post_tests_csharp.sh b/tools/run_tests/helper_scripts/post_tests_csharp.sh index f92ea00293..6473dfd015 100755 --- a/tools/run_tests/helper_scripts/post_tests_csharp.sh +++ b/tools/run_tests/helper_scripts/post_tests_csharp.sh @@ -18,7 +18,7 @@ set -ex if [ "$CONFIG" != "gcov" ] ; then exit ; fi # change to gRPC repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." # Generate the csharp extension coverage report gcov objs/gcov/src/csharp/ext/*.o diff --git a/tools/run_tests/helper_scripts/post_tests_php.sh b/tools/run_tests/helper_scripts/post_tests_php.sh index 8ebc1e4fae..b23e4bd113 100755 --- a/tools/run_tests/helper_scripts/post_tests_php.sh +++ b/tools/run_tests/helper_scripts/post_tests_php.sh @@ -17,15 +17,15 @@ set -ex if [ "$CONFIG" != "gcov" ] ; then exit ; fi -root=$(readlink -f $(dirname $0)/../../..) +root=$(readlink -f "$(dirname "$0")/../../..") out=$root/reports/php_ext_coverage tmp1=$(mktemp) tmp2=$(mktemp) -cd $root -lcov --capture --directory . --output-file $tmp1 -lcov --extract $tmp1 "$root/src/php/ext/grpc/*" --output-file $tmp2 -genhtml $tmp2 --output-directory $out -rm $tmp2 -rm $tmp1 +cd "$root" +lcov --capture --directory . --output-file "$tmp1" +lcov --extract "$tmp1" "$root/src/php/ext/grpc/*" --output-file "$tmp2" +genhtml "$tmp2" --output-directory "$out" +rm "$tmp2" +rm "$tmp1" # todo(mattkwong): generate coverage report for php and copy to reports/php diff --git a/tools/run_tests/helper_scripts/post_tests_python.sh b/tools/run_tests/helper_scripts/post_tests_python.sh index 071e81af7d..bca9b20ecc 100755 --- a/tools/run_tests/helper_scripts/post_tests_python.sh +++ b/tools/run_tests/helper_scripts/post_tests_python.sh @@ -18,7 +18,7 @@ set -ex if [ "$CONFIG" != "gcov" ] ; then exit ; fi # change to directory of Python coverage files -cd $(dirname $0)/../../../src/python/grpcio_tests/ +cd "$(dirname "$0")/../../../src/python/grpcio_tests/" coverage combine . coverage html -i -d ./../../../reports/python diff --git a/tools/run_tests/helper_scripts/post_tests_ruby.sh b/tools/run_tests/helper_scripts/post_tests_ruby.sh index a0b0736f53..f086001524 100755 --- a/tools/run_tests/helper_scripts/post_tests_ruby.sh +++ b/tools/run_tests/helper_scripts/post_tests_ruby.sh @@ -17,15 +17,15 @@ set -ex if [ "$CONFIG" != "gcov" ] ; then exit ; fi -root=$(readlink -f $(dirname $0)/../../..) +root=$(readlink -f "$(dirname "$0")/../../..") out=$root/reports/ruby_ext_coverage tmp1=$(mktemp) tmp2=$(mktemp) -cd $root -lcov --capture --directory . --output-file $tmp1 -lcov --extract $tmp1 "$root/src/ruby/*" --output-file $tmp2 -genhtml $tmp2 --output-directory $out -rm $tmp2 -rm $tmp1 +cd "$root" +lcov --capture --directory . --output-file "$tmp1" +lcov --extract "$tmp1" "$root/src/ruby/*" --output-file "$tmp2" +genhtml "$tmp2" --output-directory "$out" +rm "$tmp2" +rm "$tmp1" -cp -rv $root/coverage $root/reports/ruby +cp -rv "$root/coverage" "$root/reports/ruby" diff --git a/tools/run_tests/helper_scripts/pre_build_cmake.sh b/tools/run_tests/helper_scripts/pre_build_cmake.sh index 0300cd8a55..bb36588bcc 100755 --- a/tools/run_tests/helper_scripts/pre_build_cmake.sh +++ b/tools/run_tests/helper_scripts/pre_build_cmake.sh @@ -15,10 +15,10 @@ set -ex -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." mkdir -p cmake/build cd cmake/build # MSBUILD_CONFIG's values are suitable for cmake as well -cmake -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${MSBUILD_CONFIG} ../.. +cmake -DgRPC_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE="${MSBUILD_CONFIG}" ../.. diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.sh b/tools/run_tests/helper_scripts/pre_build_csharp.sh index e2aeddcd7a..f9f5440a61 100755 --- a/tools/run_tests/helper_scripts/pre_build_csharp.sh +++ b/tools/run_tests/helper_scripts/pre_build_csharp.sh @@ -16,6 +16,6 @@ set -ex # cd to gRPC csharp directory -cd $(dirname $0)/../../../src/csharp +cd "$(dirname "$0")/../../../src/csharp" dotnet restore Grpc.sln diff --git a/tools/run_tests/helper_scripts/pre_build_ruby.sh b/tools/run_tests/helper_scripts/pre_build_ruby.sh index d68f7e9ff5..b5740963ee 100755 --- a/tools/run_tests/helper_scripts/pre_build_ruby.sh +++ b/tools/run_tests/helper_scripts/pre_build_ruby.sh @@ -19,6 +19,6 @@ set -ex export GRPC_CONFIG=${CONFIG:-opt} # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." tools/run_tests/helper_scripts/bundle_install_wrapper.sh diff --git a/tools/run_tests/helper_scripts/run_grpc-node.sh b/tools/run_tests/helper_scripts/run_grpc-node.sh index 25f149f579..747aae7fd5 100755 --- a/tools/run_tests/helper_scripts/run_grpc-node.sh +++ b/tools/run_tests/helper_scripts/run_grpc-node.sh @@ -17,12 +17,12 @@ # to this reference # cd to gRPC root directory -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." -CURRENT_COMMIT=$(git rev-parse --verify HEAD) +CURRENT_COMMIT="$(git rev-parse --verify HEAD)" rm -rf ./../grpc-node git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node cd ./../grpc-node -./test-grpc-submodule.sh $CURRENT_COMMIT +./test-grpc-submodule.sh "$CURRENT_COMMIT" diff --git a/tools/run_tests/helper_scripts/run_lcov.sh b/tools/run_tests/helper_scripts/run_lcov.sh index c7b2cfea62..9d8b6793fc 100755 --- a/tools/run_tests/helper_scripts/run_lcov.sh +++ b/tools/run_tests/helper_scripts/run_lcov.sh @@ -15,17 +15,17 @@ set -ex -out=$(readlink -f ${1:-coverage}) +out=$(readlink -f "${1:-coverage}") -root=$(readlink -f $(dirname $0)/../../..) +root=$(readlink -f "$(dirname "$0")/../../..") shift || true tmp=$(mktemp) -cd $root -tools/run_tests/run_tests.py -c gcov -l c c++ $@ || true -lcov --capture --directory . --output-file $tmp -genhtml $tmp --output-directory $out -rm $tmp +cd "$root" +tools/run_tests/run_tests.py -c gcov -l c c++ "$@" || true +lcov --capture --directory . --output-file "$tmp" +genhtml "$tmp" --output-directory "$out" +rm "$tmp" if which xdg-open > /dev/null then - xdg-open file://$out/index.html + xdg-open "file://$out/index.html" fi diff --git a/tools/run_tests/helper_scripts/run_python.sh b/tools/run_tests/helper_scripts/run_python.sh index 90f28c8ba8..bcfe3a6577 100755 --- a/tools/run_tests/helper_scripts/run_python.sh +++ b/tools/run_tests/helper_scripts/run_python.sh @@ -16,15 +16,15 @@ set -ex # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." -PYTHON=`realpath "${1:-py27/bin/python}"` +PYTHON=$(realpath "${1:-py27/bin/python}") -ROOT=`pwd` +ROOT=$(pwd) -$PYTHON $ROOT/src/python/grpcio_tests/setup.py test_lite +$PYTHON "$ROOT/src/python/grpcio_tests/setup.py" test_lite -mkdir -p $ROOT/reports -rm -rf $ROOT/reports/python-coverage -(mv -T $ROOT/htmlcov $ROOT/reports/python-coverage) || true +mkdir -p "$ROOT/reports" +rm -rf "$ROOT/reports/python-coverage" +(mv -T "$ROOT/htmlcov" "$ROOT/reports/python-coverage") || true diff --git a/tools/run_tests/helper_scripts/run_ruby.sh b/tools/run_tests/helper_scripts/run_ruby.sh index 4bd7d743c1..4e9c212877 100755 --- a/tools/run_tests/helper_scripts/run_ruby.sh +++ b/tools/run_tests/helper_scripts/run_ruby.sh @@ -16,6 +16,6 @@ set -ex # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." rake diff --git a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh index 5cfab14fee..195544200a 100755 --- a/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh +++ b/tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh @@ -16,7 +16,7 @@ set -ex # change to grpc repo root -cd $(dirname $0)/../../.. +cd "$(dirname "$0")/../../.." EXIT_CODE=0 ruby src/ruby/end2end/sig_handling_driver.rb || EXIT_CODE=1 diff --git a/tools/run_tests/helper_scripts/run_tests_in_workspace.sh b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh index 529dc0444a..790c041881 100755 --- a/tools/run_tests/helper_scripts/run_tests_in_workspace.sh +++ b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh @@ -19,15 +19,15 @@ # newly created workspace) set -ex -cd $(dirname $0)/../../.. -export repo_root=$(pwd) +cd "$(dirname "$0")/../../.." +export repo_root="$(pwd)" rm -rf "${WORKSPACE_NAME}" git clone . "${WORKSPACE_NAME}" # clone gRPC submodules, use data from locally cloned submodules where possible +# shellcheck disable=SC2016,SC1004 git submodule foreach 'cd "${repo_root}/${WORKSPACE_NAME}" \ && git submodule update --init --reference ${repo_root}/${name} ${name}' echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" -python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ - +python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" "$@" |