From 3bfa56fcead2f8e895ed84f20e4de4f62f1e88f7 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 11:36:45 -0700 Subject: Fix build_python.sh to pass shellcheck --- tools/run_tests/helper_scripts/build_python.sh | 56 +++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) 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" -- cgit v1.2.3 From 0ccd3af0e8900a30e7f066b4c1da04888988a954 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 11:44:07 -0700 Subject: Fix build_csharp.sh to pass shellcheck --- tools/run_tests/helper_scripts/build_csharp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 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 -- cgit v1.2.3 From 009941ed51bf80a3d49b088b49e5350db7300ea8 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 12:39:29 -0700 Subject: Fix build_php.sh to pass shellcheck --- tools/run_tests/helper_scripts/build_php.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- cgit v1.2.3 From 3b6dcfa3be445f3468dddff2e68e41f9e8a078ed Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 12:41:40 -0700 Subject: Fix build_python_msys2.sh to pass shellcheck --- tools/run_tests/helper_scripts/build_python_msys2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" "$@" -- cgit v1.2.3 From ba137985fff22278a5af947dee4effe9fb338a5d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 12:42:50 -0700 Subject: Fix build_ruby.sh to pass shellcheck --- tools/run_tests/helper_scripts/build_ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From 517d298071b36fe1f9e3597a4b08813742be96e9 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 12:45:03 -0700 Subject: Fix bundle_install_wrapper.sh to pass shellcheck --- tools/run_tests/helper_scripts/bundle_install_wrapper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- cgit v1.2.3 From 1a0ff1edb48950c5a3d309e8948665bddfb148fc Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:44:55 -0700 Subject: Fix post_tests_c.sh to pass shellcheck --- tools/run_tests/helper_scripts/post_tests_c.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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" -- cgit v1.2.3 From d8ef4887dd4394a4d6cd9ca065160e4afad77a0a Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:45:09 -0700 Subject: Fix post_tests_csharp.sh to pass shellcheck --- tools/run_tests/helper_scripts/post_tests_csharp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From 4ef3c9217054385d6f7d2e8d65129e07dea32c93 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:46:33 -0700 Subject: Fix post_tests_php.sh to pass shellcheck --- tools/run_tests/helper_scripts/post_tests_php.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 -- cgit v1.2.3 From d3143cd90fcd95a0b7bd4f35ad953efd182aedcf Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:47:14 -0700 Subject: Fix post_tests_python.sh to pass shellcheck --- tools/run_tests/helper_scripts/post_tests_python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From d4db0986e11e1e30d2c8b325cbb89d2f8bbc90bb Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:48:25 -0700 Subject: Fix post_tests_ruby.sh to pass shellcheck --- tools/run_tests/helper_scripts/post_tests_ruby.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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" -- cgit v1.2.3 From d8b9243d2177eeb94275f7531dfcbc74f6df5b39 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:58:43 -0700 Subject: Fix pre_build_cmake.sh to pass shellcheck --- tools/run_tests/helper_scripts/pre_build_cmake.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}" ../.. -- cgit v1.2.3 From 51d6c6651774ac1a3f64cfc27f415d0ac9aa94ed Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 14:59:03 -0700 Subject: Fix pre_build_csharp.sh to pass shellcheck --- tools/run_tests/helper_scripts/pre_build_csharp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From fa98f1d08633be092237c5acf4c706ff66225e9e Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 17:04:26 -0700 Subject: Fix pre_build_ruby.sh to pass shellcheck --- tools/run_tests/helper_scripts/pre_build_ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From 4da34aa8f0257174ceb2fd811f2af1a5edab1392 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 17:06:00 -0700 Subject: Fix run_lcov.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_lcov.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 -- cgit v1.2.3 From 3d1dc96f4751857f164af191228834a7dd42f162 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 17:18:09 -0700 Subject: Fix run_python.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_python.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 -- cgit v1.2.3 From e0614e75ef0b7e6cdf626049546d6c3db1c25997 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 17:18:31 -0700 Subject: Fix run_ruby.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_ruby.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From 4fc1317565f106355963ddf34c70cdb179a5faf5 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Tue, 27 Jun 2017 17:18:58 -0700 Subject: Fix run_ruby_end2end_tests.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_ruby_end2end_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From af3eb698566ab6a53a9b23bd6390f86dc772af67 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 15 Dec 2017 13:33:10 -0800 Subject: Fix run_grpc-node.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_grpc-node.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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" -- cgit v1.2.3 From 290bbd2111fb7069c89cd154965a4dc78b63c95f Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Fri, 15 Dec 2017 13:38:59 -0800 Subject: Fix run_tests_in_workspace.sh to pass shellcheck --- tools/run_tests/helper_scripts/run_tests_in_workspace.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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" "$@" -- cgit v1.2.3