Skip to content

Commit 6b00363

Browse files
Make run_tests.sh less spammy. (#9237)
Co-authored-by: Zhanyong Wan <[email protected]>
1 parent 01a235b commit 6b00363

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

test/run_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ function run_pt_xla_debug_level1 {
132132
}
133133

134134
function run_pt_xla_debug_level2 {
135+
if ! test_is_selected "$1"; then
136+
return
137+
fi
135138
echo "Running in save tensor file mode: $@"
136139
PT_XLA_DEBUG_LEVEL=2 PT_XLA_DEBUG_FILE="/tmp/pt_xla_debug.txt" run_test "$@"
137140
}

test/utils/run_tests_utils.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set -exo pipefail
33

44
# Parses the commandline flags and sets correponding environment variables.
55
function parse_options_to_vars {
6+
set +x # echo off
67
# Default option values. Can be overridden via commandline flags.
78
LOGFILE=/tmp/pytorch_py_test.log
89
VERBOSITY=2
@@ -31,12 +32,14 @@ function parse_options_to_vars {
3132
exit 1
3233
esac
3334
done
35+
set -x # echo on
3436
}
3537

3638
# Given $1 as a (possibly not normalized) test filepath, returns successfully
3739
# if it matches any of the space-separated globs $_TEST_FILTER. If
3840
# $_TEST_FILTER is empty, returns successfully.
3941
function test_is_selected {
42+
set +x # echo off
4043
if [[ -z "$_TEST_FILTER" ]]; then
4144
return 0 # success
4245
fi
@@ -48,6 +51,8 @@ function test_is_selected {
4851
# so that they can be compared.
4952
case $(realpath $1) in
5053
$(realpath $_FILTER))
54+
echo "RUNNING: $@"
55+
set -x # echo on
5156
return 0 # success
5257
;;
5358
*)
@@ -56,6 +61,7 @@ function test_is_selected {
5661
esac
5762
done
5863

64+
set -x # echo on
5965
return 1 # failure
6066
}
6167

0 commit comments

Comments
 (0)