From a5ae3e26d0e9eeb72b1374d8e54bd7f470eb84a7 Mon Sep 17 00:00:00 2001 From: driazati Date: Mon, 23 May 2022 16:29:32 -0700 Subject: [PATCH] [ci] Add -x to all CI scripts Fixes #10316 --- tests/scripts/task_ci_setup.sh | 4 +--- tests/scripts/task_clean.sh | 2 ++ tests/scripts/task_config_build_arm.sh | 3 +-- tests/scripts/task_config_build_cpu.sh | 3 +-- tests/scripts/task_config_build_gpu.sh | 3 +-- tests/scripts/task_config_build_gpu_other.sh | 4 +--- tests/scripts/task_config_build_gpu_vulkan.sh | 2 +- tests/scripts/task_config_build_hexagon.sh | 3 +-- tests/scripts/task_config_build_i386.sh | 3 +-- tests/scripts/task_config_build_qemu.sh | 3 +-- tests/scripts/task_config_build_wasm.sh | 3 +-- tests/scripts/task_convert_scripts_to_python.sh | 1 + tests/scripts/task_golang.sh | 3 +-- tests/scripts/task_java_unittest.sh | 3 +-- tests/scripts/task_mypy.sh | 5 ++--- tests/scripts/task_python_arm_compute_library.sh | 4 ++-- tests/scripts/task_python_docs.sh | 2 +- tests/scripts/task_python_ethosn_tests.sh | 4 ++-- tests/scripts/task_python_frontend_cpu.sh | 3 +-- tests/scripts/task_python_hexagon.sh | 3 +-- tests/scripts/task_python_integration_gpuonly.sh | 2 ++ tests/scripts/task_python_integration_i386only.sh | 4 ++-- tests/scripts/task_python_microtvm.sh | 5 ++--- tests/scripts/task_python_nightly.sh | 3 +-- tests/scripts/task_python_topi.sh | 3 +-- tests/scripts/task_python_vta_fsim.sh | 3 +-- tests/scripts/task_python_vta_tsim.sh | 3 +-- tests/scripts/task_rust.sh | 3 +-- tests/scripts/task_show_node_info.sh | 2 +- 29 files changed, 36 insertions(+), 53 deletions(-) diff --git a/tests/scripts/task_ci_setup.sh b/tests/scripts/task_ci_setup.sh index 91c879248789..5af0d0c9801e 100755 --- a/tests/scripts/task_ci_setup.sh +++ b/tests/scripts/task_ci_setup.sh @@ -16,9 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u -set -o pipefail +set -euxo pipefail # Script to setup additional python env. # diff --git a/tests/scripts/task_clean.sh b/tests/scripts/task_clean.sh index 2ddc0d3db84d..3ae70b346c1b 100755 --- a/tests/scripts/task_clean.sh +++ b/tests/scripts/task_clean.sh @@ -15,5 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +set -euxo pipefail + echo "Cleanup data..." cd $1 && rm -rf standalone_crt && rm -rf host_standalone_crt && rm -rf CMake* && cd .. diff --git a/tests/scripts/task_config_build_arm.sh b/tests/scripts/task_config_build_arm.sh index b95b20aa4f06..189bdc250a8c 100755 --- a/tests/scripts/task_config_build_arm.sh +++ b/tests/scripts/task_config_build_arm.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_cpu.sh b/tests/scripts/task_config_build_cpu.sh index a43edcf74485..b67d3823ca84 100755 --- a/tests/scripts/task_config_build_cpu.sh +++ b/tests/scripts/task_config_build_cpu.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_gpu.sh b/tests/scripts/task_config_build_gpu.sh index 0145eb387bf4..9a71983886dd 100755 --- a/tests/scripts/task_config_build_gpu.sh +++ b/tests/scripts/task_config_build_gpu.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_gpu_other.sh b/tests/scripts/task_config_build_gpu_other.sh index 07515d64ada3..9943d9b2514e 100755 --- a/tests/scripts/task_config_build_gpu_other.sh +++ b/tests/scripts/task_config_build_gpu_other.sh @@ -18,9 +18,7 @@ # This file is a compiler test to ensure that runtimes can compile # correctly, even if they aren't actively tested in the CI. - -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_gpu_vulkan.sh b/tests/scripts/task_config_build_gpu_vulkan.sh index eb26730e89d4..f3859b9aa04d 100755 --- a/tests/scripts/task_config_build_gpu_vulkan.sh +++ b/tests/scripts/task_config_build_gpu_vulkan.sh @@ -23,6 +23,6 @@ # Jenkinsfile from the ci-docker-staging branch, but the task scripts # from the PR branch. -set -euo pipefail +set -euxo pipefail ./tests/scripts/task_config_build_gpu_other.sh diff --git a/tests/scripts/task_config_build_hexagon.sh b/tests/scripts/task_config_build_hexagon.sh index a38180a2d971..a943d72e3635 100755 --- a/tests/scripts/task_config_build_hexagon.sh +++ b/tests/scripts/task_config_build_hexagon.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_i386.sh b/tests/scripts/task_config_build_i386.sh index b06fe5f3e7d7..c92aed3c1450 100755 --- a/tests/scripts/task_config_build_i386.sh +++ b/tests/scripts/task_config_build_i386.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_qemu.sh b/tests/scripts/task_config_build_qemu.sh index d312f2f6c5f0..a2c708c6d113 100755 --- a/tests/scripts/task_config_build_qemu.sh +++ b/tests/scripts/task_config_build_qemu.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_config_build_wasm.sh b/tests/scripts/task_config_build_wasm.sh index b55463d3244c..daa5481bea9d 100755 --- a/tests/scripts/task_config_build_wasm.sh +++ b/tests/scripts/task_config_build_wasm.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail BUILD_DIR=$1 mkdir -p "$BUILD_DIR" diff --git a/tests/scripts/task_convert_scripts_to_python.sh b/tests/scripts/task_convert_scripts_to_python.sh index b2164cbdbbcf..521abc5e208c 100755 --- a/tests/scripts/task_convert_scripts_to_python.sh +++ b/tests/scripts/task_convert_scripts_to_python.sh @@ -15,6 +15,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +set -euxo pipefail SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}") TVM_DIR=$(cd "${SCRIPTS_DIR}" && git rev-parse --show-toplevel) diff --git a/tests/scripts/task_golang.sh b/tests/scripts/task_golang.sh index b79a2a5d9208..62eb8081eb9d 100755 --- a/tests/scripts/task_golang.sh +++ b/tests/scripts/task_golang.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" diff --git a/tests/scripts/task_java_unittest.sh b/tests/scripts/task_java_unittest.sh index 70ad53d62737..33467e661487 100755 --- a/tests/scripts/task_java_unittest.sh +++ b/tests/scripts/task_java_unittest.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail export PYTHONPATH=python export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}" diff --git a/tests/scripts/task_mypy.sh b/tests/scripts/task_mypy.sh index c26ab73846b3..1ef7db589432 100755 --- a/tests/scripts/task_mypy.sh +++ b/tests/scripts/task_mypy.sh @@ -16,9 +16,8 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u -set -o pipefail +set -euxo pipefail + source tests/scripts/setup-pytest-env.sh echo "Checking MyPy Type defs in the TensorIR schedule package." diff --git a/tests/scripts/task_python_arm_compute_library.sh b/tests/scripts/task_python_arm_compute_library.sh index bc0cf176099b..51b453e2b862 100755 --- a/tests/scripts/task_python_arm_compute_library.sh +++ b/tests/scripts/task_python_arm_compute_library.sh @@ -16,8 +16,8 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail + source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_docs.sh b/tests/scripts/task_python_docs.sh index b947c65ec6cc..b4b52ed36ccf 100755 --- a/tests/scripts/task_python_docs.sh +++ b/tests/scripts/task_python_docs.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -euo pipefail +set -euxo pipefail source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_ethosn_tests.sh b/tests/scripts/task_python_ethosn_tests.sh index aeef9e64b251..d49b8518a4ad 100755 --- a/tests/scripts/task_python_ethosn_tests.sh +++ b/tests/scripts/task_python_ethosn_tests.sh @@ -16,8 +16,8 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail + source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_frontend_cpu.sh b/tests/scripts/task_python_frontend_cpu.sh index f12177dc7f93..52c3d1078edf 100755 --- a/tests/scripts/task_python_frontend_cpu.sh +++ b/tests/scripts/task_python_frontend_cpu.sh @@ -17,8 +17,7 @@ # under the License. # Test frontends that only need CPU resources -set -e -set -u +set -euxo pipefail source tests/scripts/setup-pytest-env.sh # to avoid openblas threading error diff --git a/tests/scripts/task_python_hexagon.sh b/tests/scripts/task_python_hexagon.sh index 883c296c5056..c87bc9b250fa 100755 --- a/tests/scripts/task_python_hexagon.sh +++ b/tests/scripts/task_python_hexagon.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail device_serial="simulator" if [ $# -ge 1 ] && [[ "$1" = "--device" ]]; then diff --git a/tests/scripts/task_python_integration_gpuonly.sh b/tests/scripts/task_python_integration_gpuonly.sh index d4d6e26d88f2..3ce5571caa0e 100755 --- a/tests/scripts/task_python_integration_gpuonly.sh +++ b/tests/scripts/task_python_integration_gpuonly.sh @@ -16,6 +16,8 @@ # specific language governing permissions and limitations # under the License. +set -exo pipefail + export TVM_TEST_TARGETS="cuda;opencl;metal;rocm;nvptx;opencl -device=mali,aocl_sw_emu" export PYTEST_ADDOPTS="-m gpu $PYTEST_ADDOPTS" export TVM_RELAY_TEST_TARGETS="cuda" diff --git a/tests/scripts/task_python_integration_i386only.sh b/tests/scripts/task_python_integration_i386only.sh index 9b0c30b7aeef..f4fe311671ff 100755 --- a/tests/scripts/task_python_integration_i386only.sh +++ b/tests/scripts/task_python_integration_i386only.sh @@ -15,8 +15,8 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail + export TVM_INTEGRATION_I386_ONLY=1 diff --git a/tests/scripts/task_python_microtvm.sh b/tests/scripts/task_python_microtvm.sh index 7301c6f833ab..557e938a6ed3 100755 --- a/tests/scripts/task_python_microtvm.sh +++ b/tests/scripts/task_python_microtvm.sh @@ -16,9 +16,8 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u -set -x # NOTE(areusch): Adding to diagnose flaky timeouts +set -euxo pipefail + source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_nightly.sh b/tests/scripts/task_python_nightly.sh index 225892b02b79..f8423602bd4b 100755 --- a/tests/scripts/task_python_nightly.sh +++ b/tests/scripts/task_python_nightly.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_topi.sh b/tests/scripts/task_python_topi.sh index 8389e12f5b0c..3916e0a754f3 100755 --- a/tests/scripts/task_python_topi.sh +++ b/tests/scripts/task_python_topi.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail source tests/scripts/setup-pytest-env.sh diff --git a/tests/scripts/task_python_vta_fsim.sh b/tests/scripts/task_python_vta_fsim.sh index 6ba78167ac8c..cd96b278d860 100755 --- a/tests/scripts/task_python_vta_fsim.sh +++ b/tests/scripts/task_python_vta_fsim.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail source tests/scripts/setup-pytest-env.sh # to avoid CI thread throttling. diff --git a/tests/scripts/task_python_vta_tsim.sh b/tests/scripts/task_python_vta_tsim.sh index 95d1a2cbf001..d6a181fb570c 100755 --- a/tests/scripts/task_python_vta_tsim.sh +++ b/tests/scripts/task_python_vta_tsim.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail source tests/scripts/setup-pytest-env.sh export PYTHONPATH=${PYTHONPATH}:${TVM_PATH}/vta/python diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh index 0c0e283afd35..93e5346f4932 100755 --- a/tests/scripts/task_rust.sh +++ b/tests/scripts/task_rust.sh @@ -16,8 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -e -set -u +set -euxo pipefail export TVM_HOME="$(git rev-parse --show-toplevel)" echo "Using TVM_HOME=$TVM_HOME" diff --git a/tests/scripts/task_show_node_info.sh b/tests/scripts/task_show_node_info.sh index a89e10e8c769..f68216723484 100755 --- a/tests/scripts/task_show_node_info.sh +++ b/tests/scripts/task_show_node_info.sh @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. -set -x +set -euxo pipefail echo "===== JENKINS INFO =====" echo "NODE_NAME=$NODE_NAME"