aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Lidi Zheng <lidiz@google.com>2018-12-10 16:19:35 -0800
committerGravatar Lidi Zheng <lidiz@google.com>2018-12-10 16:21:49 -0800
commit8cb2d0546d14574977c4943d33bb103954078bbd (patch)
treec7090a0cd3c81e36c95c8a5ca0232d88a6184689 /tools/run_tests
parent60f2d379fec3364ff59f4f0d463b16275525863d (diff)
Upgrade sanity Docker image to debian:stretch
* Use latest pylint in Python 3.7 (they dropped support for PY2) * Make latest pylint happy * Forced to upgrade to shellcheck 0.4.4 * Make shellcheck 0.4.4 happy * Adopt reviewers' advice to reduce global disabled rules
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_protoc.sh1
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_ruby.sh2
-rwxr-xr-xtools/run_tests/artifacts/run_in_workspace.sh3
-rwxr-xr-xtools/run_tests/dockerize/build_and_run_docker.sh2
-rwxr-xr-xtools/run_tests/dockerize/build_docker_and_run_tests.sh4
-rwxr-xr-xtools/run_tests/dockerize/build_interop_image.sh2
-rwxr-xr-xtools/run_tests/dockerize/docker_run_tests.sh1
-rwxr-xr-xtools/run_tests/helper_scripts/run_grpc-node.sh2
-rwxr-xr-xtools/run_tests/helper_scripts/run_tests_in_workspace.sh3
-rwxr-xr-xtools/run_tests/interop/with_nvm.sh1
-rwxr-xr-xtools/run_tests/interop/with_rvm.sh1
-rwxr-xr-xtools/run_tests/performance/build_performance.sh1
-rwxr-xr-xtools/run_tests/performance/build_performance_go.sh3
-rwxr-xr-xtools/run_tests/performance/build_performance_node.sh1
-rwxr-xr-xtools/run_tests/performance/run_worker_go.sh3
-rwxr-xr-xtools/run_tests/performance/run_worker_node.sh1
-rwxr-xr-xtools/run_tests/performance/run_worker_php.sh1
-rwxr-xr-xtools/run_tests/performance/run_worker_ruby.sh1
18 files changed, 25 insertions, 8 deletions
diff --git a/tools/run_tests/artifacts/build_artifact_protoc.sh b/tools/run_tests/artifacts/build_artifact_protoc.sh
index 6d433f2dad..a5b6e2f348 100755
--- a/tools/run_tests/artifacts/build_artifact_protoc.sh
+++ b/tools/run_tests/artifacts/build_artifact_protoc.sh
@@ -14,6 +14,7 @@
# limitations under the License.
# Use devtoolset environment that has GCC 4.8 before set -ex
+# shellcheck disable=SC1091
source scl_source enable devtoolset-2
set -ex
diff --git a/tools/run_tests/artifacts/build_artifact_ruby.sh b/tools/run_tests/artifacts/build_artifact_ruby.sh
index 5ab4cf21b4..c910374376 100755
--- a/tools/run_tests/artifacts/build_artifact_ruby.sh
+++ b/tools/run_tests/artifacts/build_artifact_ruby.sh
@@ -18,7 +18,9 @@ SYSTEM=$(uname | cut -f 1 -d_)
cd "$(dirname "$0")/../../.."
set +ex
+# shellcheck disable=SC1091
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
+# shellcheck disable=SC1090
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
set -ex
diff --git a/tools/run_tests/artifacts/run_in_workspace.sh b/tools/run_tests/artifacts/run_in_workspace.sh
index 20181e077c..f4719b0a4a 100755
--- a/tools/run_tests/artifacts/run_in_workspace.sh
+++ b/tools/run_tests/artifacts/run_in_workspace.sh
@@ -19,7 +19,8 @@
set -ex
cd "$(dirname "$0")/../../.."
-export repo_root=$(pwd)
+repo_root=$(pwd)
+export repo_root
# TODO: fix file to pass shellcheck
diff --git a/tools/run_tests/dockerize/build_and_run_docker.sh b/tools/run_tests/dockerize/build_and_run_docker.sh
index 3f01fbc7b7..9d0efc8b40 100755
--- a/tools/run_tests/dockerize/build_and_run_docker.sh
+++ b/tools/run_tests/dockerize/build_and_run_docker.sh
@@ -20,7 +20,7 @@ set -ex
cd "$(dirname "$0")/../../.."
git_root=$(pwd)
-cd -
+cd - # shellcheck disable=SC2103
# Inputs
# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
index 1741b3268b..a63e1be96d 100755
--- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh
+++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
@@ -20,7 +20,7 @@ set -ex
cd "$(dirname "$0")/../../.."
git_root=$(pwd)
-cd -
+cd - # shellcheck disable=SC2103
# Inputs
# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
@@ -48,7 +48,7 @@ docker_instance_git_root=/var/local/jenkins/grpc
# Run tests inside docker
DOCKER_EXIT_CODE=0
# TODO: silence complaint about $TTY_FLAG expansion in some other way
-# shellcheck disable=SC2086
+# shellcheck disable=SC2086,SC2154
docker run \
--cap-add SYS_PTRACE \
-e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \
diff --git a/tools/run_tests/dockerize/build_interop_image.sh b/tools/run_tests/dockerize/build_interop_image.sh
index 126dd4065e..0f88787639 100755
--- a/tools/run_tests/dockerize/build_interop_image.sh
+++ b/tools/run_tests/dockerize/build_interop_image.sh
@@ -16,7 +16,7 @@
# This script is invoked by run_interop_tests.py to build the docker image
# for interop testing. You should never need to call this script on your own.
-set -x
+set -ex
# Params:
# INTEROP_IMAGE - name of tag of the final interop image
diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh
index b7686e48ba..5214938208 100755
--- a/tools/run_tests/dockerize/docker_run_tests.sh
+++ b/tools/run_tests/dockerize/docker_run_tests.sh
@@ -18,6 +18,7 @@
set -e
+# shellcheck disable=SC2154
export CONFIG=$config
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
export PATH=$PATH:/usr/bin/llvm-symbolizer
diff --git a/tools/run_tests/helper_scripts/run_grpc-node.sh b/tools/run_tests/helper_scripts/run_grpc-node.sh
index 747aae7fd5..d14753a4d5 100755
--- a/tools/run_tests/helper_scripts/run_grpc-node.sh
+++ b/tools/run_tests/helper_scripts/run_grpc-node.sh
@@ -16,6 +16,8 @@
# This script runs grpc/grpc-node tests with their grpc submodule updated
# to this reference
+set -ex
+
# cd to gRPC root directory
cd "$(dirname "$0")/../../.."
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 790c041881..fa7a7aac0a 100755
--- a/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
+++ b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
@@ -20,7 +20,8 @@
set -ex
cd "$(dirname "$0")/../../.."
-export repo_root="$(pwd)"
+repo_root="$(pwd)"
+export repo_root
rm -rf "${WORKSPACE_NAME}"
git clone . "${WORKSPACE_NAME}"
diff --git a/tools/run_tests/interop/with_nvm.sh b/tools/run_tests/interop/with_nvm.sh
index 887f9f6a9f..55f4b2b875 100755
--- a/tools/run_tests/interop/with_nvm.sh
+++ b/tools/run_tests/interop/with_nvm.sh
@@ -15,5 +15,6 @@
# limitations under the License.
# Makes sure NVM is loaded before executing the command passed as an argument
+# shellcheck disable=SC1090
source ~/.nvm/nvm.sh
"$@"
diff --git a/tools/run_tests/interop/with_rvm.sh b/tools/run_tests/interop/with_rvm.sh
index 41e6efcb56..82bce9da12 100755
--- a/tools/run_tests/interop/with_rvm.sh
+++ b/tools/run_tests/interop/with_rvm.sh
@@ -15,5 +15,6 @@
# limitations under the License.
# Makes sure RVM is loaded before executing the command passed as an argument
+# shellcheck disable=SC1091
source /usr/local/rvm/scripts/rvm
"$@"
diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh
index ab6bffdc34..6c22e2d37d 100755
--- a/tools/run_tests/performance/build_performance.sh
+++ b/tools/run_tests/performance/build_performance.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# shellcheck disable=SC1090
source ~/.rvm/scripts/rvm
set -ex
diff --git a/tools/run_tests/performance/build_performance_go.sh b/tools/run_tests/performance/build_performance_go.sh
index 812728d4ce..3aa203a6ee 100755
--- a/tools/run_tests/performance/build_performance_go.sh
+++ b/tools/run_tests/performance/build_performance_go.sh
@@ -17,7 +17,8 @@ set -ex
cd "$(dirname "$0")/../../.."
-export GOPATH=$(pwd)/../gopath
+GOPATH=$(pwd)/../gopath
+export GOPATH
# Get grpc-go and the dependencies but get rid of the upstream/master version
go get google.golang.org/grpc
diff --git a/tools/run_tests/performance/build_performance_node.sh b/tools/run_tests/performance/build_performance_node.sh
index 12e0872264..b5b5d9a1a2 100755
--- a/tools/run_tests/performance/build_performance_node.sh
+++ b/tools/run_tests/performance/build_performance_node.sh
@@ -15,6 +15,7 @@
set +ex
+# shellcheck disable=SC1090
. "$HOME/.nvm/nvm.sh"
nvm install 10
diff --git a/tools/run_tests/performance/run_worker_go.sh b/tools/run_tests/performance/run_worker_go.sh
index f8e821a265..1127f4f25a 100755
--- a/tools/run_tests/performance/run_worker_go.sh
+++ b/tools/run_tests/performance/run_worker_go.sh
@@ -17,6 +17,7 @@ set -ex
cd "$(dirname "$0")/../../.."
-export GOPATH=$(pwd)/../gopath
+GOPATH=$(pwd)/../gopath
+export GOPATH
"${GOPATH}/bin/worker" "$@"
diff --git a/tools/run_tests/performance/run_worker_node.sh b/tools/run_tests/performance/run_worker_node.sh
index 3e5dd18edb..658cd50811 100755
--- a/tools/run_tests/performance/run_worker_node.sh
+++ b/tools/run_tests/performance/run_worker_node.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# shellcheck disable=SC1090
. "$HOME/.nvm/nvm.sh"
nvm use 10
diff --git a/tools/run_tests/performance/run_worker_php.sh b/tools/run_tests/performance/run_worker_php.sh
index 2fe2493e60..97292a9978 100755
--- a/tools/run_tests/performance/run_worker_php.sh
+++ b/tools/run_tests/performance/run_worker_php.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# shellcheck disable=SC1090
source ~/.rvm/scripts/rvm
set -ex
diff --git a/tools/run_tests/performance/run_worker_ruby.sh b/tools/run_tests/performance/run_worker_ruby.sh
index 729c5cec97..ed44846336 100755
--- a/tools/run_tests/performance/run_worker_ruby.sh
+++ b/tools/run_tests/performance/run_worker_ruby.sh
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# shellcheck disable=SC1090
source ~/.rvm/scripts/rvm
set -ex