Improve windows bazel python test suite. (#10305)

* Improve windows bazel python test suite.

- Create new tags, no_windows and no_windows_gpu
- Instead of a separate maintained list, use bazel tags to exclude tests.
- Tag all the python tests that are known to have issues in windows.

* Also blacklist neon_depthwise_conv_ops_test in windows.

* Only build tests in CPU windows tests.

* Only build tests in GPU windows tests.

* Also disable session_test on windows.

* Only run py tests on windows, and only build tests that are not
disabled.
This commit is contained in:
gunan 2017-05-31 10:52:17 -07:00 committed by GitHub
parent fe589d9e7c
commit a3520340e4
7 changed files with 53 additions and 74 deletions

View File

@ -267,6 +267,7 @@ py_test(
data = [":framework/test_file_system.so"],
main = "framework/file_system_test.py",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":client_testlib",
":data_flow_ops",
@ -678,6 +679,7 @@ py_test(
srcs = ["framework/contrib_test.py"],
main = "framework/contrib_test.py",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
"//tensorflow:tensorflow_py",
"//tensorflow/python:client_testlib",
@ -789,6 +791,7 @@ py_test(
srcs = ["framework/meta_graph_test.py"],
main = "framework/meta_graph_test.py",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":array_ops",
":client_testlib",
@ -951,6 +954,7 @@ py_test(
srcs = ["framework/tensor_util_test.py"],
main = "framework/tensor_util_test.py",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":array_ops",
":client_testlib",
@ -968,6 +972,7 @@ py_test(
srcs = ["framework/test_util_test.py"],
main = "framework/test_util_test.py",
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":control_flow_ops",
":errors",
@ -2154,6 +2159,7 @@ cuda_py_test(
":test_ops",
"//third_party/py/numpy",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -2207,6 +2213,7 @@ cuda_py_test(
],
data = ["//tensorflow/core:image_testdata"],
shard_count = 5,
tags = ["no_windows"],
)
cuda_py_test(
@ -2254,6 +2261,7 @@ cuda_py_test(
":nn_ops_gen",
"//third_party/py/numpy",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -2884,6 +2892,7 @@ cuda_py_test(
":variables",
"//third_party/py/numpy",
],
tags = ["no_windows"],
)
tf_py_test(
@ -2898,6 +2907,7 @@ tf_py_test(
":training",
":variables",
],
tags = ["no_windows"],
)
py_library(
@ -2931,6 +2941,7 @@ tf_cuda_library(
# tags = [
# "no_gpu",
# "no_pip_gpu", # testInteractivePlacePrunedGraph fails on invalid assumption about GPU ops.
# "no_windows",
# ],
# deps = [
# ":array_ops",
@ -2990,6 +3001,7 @@ py_test(
size = "small",
srcs = ["lib/io/file_io_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":client_testlib",
":errors",
@ -3139,6 +3151,7 @@ cuda_py_test(
"@six_archive//:six",
"//tensorflow/core:protos_all_py",
],
tags = ["no_windows"],
)
py_test(
@ -3203,6 +3216,7 @@ py_test(
size = "small",
srcs = ["training/supervisor_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":array_ops",
":client_testlib",
@ -3225,6 +3239,7 @@ py_test(
size = "small",
srcs = ["training/basic_session_run_hooks_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":client",
":client_testlib",
@ -3248,6 +3263,7 @@ py_test(
size = "small",
srcs = ["training/monitored_session_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":array_ops",
":client",
@ -3499,6 +3515,7 @@ py_test(
size = "small",
srcs = ["ops/dequantize_op_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":array_ops",
":client_testlib",
@ -3512,6 +3529,7 @@ py_test(
size = "small",
srcs = ["ops/quantized_conv_ops_test.py"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":client_testlib",
":framework_for_generated_wrappers",

View File

@ -472,6 +472,7 @@ py_test(
"cli/curses_ui_test.py",
],
srcs_version = "PY2AND3",
tags = ["no_windows"],
deps = [
":curses_ui",
":debugger_cli_common",

View File

@ -29,6 +29,7 @@ tf_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:string_ops",
],
tags = ["no_windows"],
)
tf_py_test(
@ -93,6 +94,7 @@ cuda_py_test(
"//tensorflow/python:platform",
"//tensorflow/python:platform_benchmark",
],
tags = ["no_windows"],
)
tf_py_test(
@ -144,6 +146,7 @@ tf_py_test(
"//tensorflow/python:clip_ops",
"//tensorflow/python:framework_for_generated_wrappers",
],
tags = ["no_windows"],
)
tf_py_test(
@ -240,6 +243,7 @@ tf_py_test(
"//tensorflow/python:nn_grad",
],
data = ["//tensorflow/core:image_testdata"],
tags = ["no_windows"],
)
tf_py_test(
@ -794,6 +798,7 @@ tf_py_test(
"//tensorflow/python:logging_ops",
"//tensorflow/python:summary",
],
tags = ["no_windows"],
)
tf_py_test(
@ -872,6 +877,7 @@ tf_py_test(
"//tensorflow/python:resource_variable_ops",
"//tensorflow/python:variables",
],
tags = ["no_windows"],
)
tf_py_test(
@ -919,7 +925,10 @@ cuda_py_test(
"//tensorflow/python:math_ops",
"//tensorflow/python:variables",
],
tags = ["noasan"],
tags = [
"no_windows",
"noasan",
],
)
cuda_py_test(
@ -950,6 +959,7 @@ tf_py_test(
"//tensorflow/python:platform",
],
shard_count = 2,
tags = ["no_windows_gpu"],
)
tf_py_test(
@ -1311,6 +1321,7 @@ cuda_py_test(
"//tensorflow/python:variable_scope",
"//tensorflow/python:variables",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -1474,6 +1485,7 @@ cuda_py_test(
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_for_generated_wrappers",
],
tags = ["no_windows_gpu"],
)
cuda_py_test(
@ -1529,6 +1541,7 @@ cuda_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:script_ops",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -1869,6 +1882,7 @@ cuda_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:parsing_ops",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -1932,6 +1946,7 @@ cuda_py_test(
"//tensorflow/python:client_testlib",
"//tensorflow/python:math_ops",
],
tags = ["no_windows_gpu"],
)
cuda_py_test(
@ -2091,6 +2106,7 @@ cuda_py_test(
"//tensorflow/python:random_ops",
"//tensorflow/python:variables",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -2106,6 +2122,7 @@ cuda_py_test(
"//tensorflow/python:nn_grad",
"//tensorflow/python:nn_ops",
],
tags = ["no_windows"],
)
tf_py_test(
@ -2121,6 +2138,7 @@ tf_py_test(
"//tensorflow/python:nn_grad",
"//tensorflow/python:nn_ops",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -2239,6 +2257,7 @@ cuda_py_test(
"//tensorflow/python:variables",
],
shard_count = 10,
tags = ["no_windows"],
)
cuda_py_test(
@ -2278,6 +2297,7 @@ cuda_py_test(
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:math_ops",
],
tags = ["no_windows"],
)
cuda_py_test(
@ -2589,6 +2609,7 @@ tf_py_test(
"//tensorflow/python:sets",
"//tensorflow/python:sparse_ops",
],
tags = ["no_windows"],
)
tf_py_test(

View File

@ -105,6 +105,7 @@ py_test(
srcs = ["saved_model_test.py"],
data = ["//tensorflow/cc/saved_model:saved_model_half_plus_two"],
srcs_version = "PY2AND3",
tags = ["no_windows"],
visibility = ["//visibility:private"],
deps = [
":builder",

View File

@ -96,64 +96,6 @@ exclude_cpu_cc_tests="${failing_cpu_cc_tests} + ${broken_cpu_cc_tests}"
exclude_gpu_cc_tests="${extra_failing_gpu_cc_tests} + ${exclude_cpu_cc_tests}"
# Python tests
# The first argument is the name of the python test directory
function get_failing_cpu_py_tests() {
echo "
//$1/tensorflow/python:basic_session_run_hooks_test + \
//$1/tensorflow/python:contrib_test + \
//$1/tensorflow/python:dequantize_op_test + \
//$1/tensorflow/python:file_io_test + \
//$1/tensorflow/python:file_system_test + \
//$1/tensorflow/python:framework_meta_graph_test + \
//$1/tensorflow/python:framework_ops_test + \
//$1/tensorflow/python:framework_tensor_util_test + \
//$1/tensorflow/python:framework_test_util_test + \
//$1/tensorflow/python:gradients_test + \
//$1/tensorflow/python:image_ops_test + \
//$1/tensorflow/python:localhost_cluster_performance_test + \
//$1/tensorflow/python:monitored_session_test + \
//$1/tensorflow/python:nn_batchnorm_test + \
//$1/tensorflow/python:protobuf_compare_test + \
//$1/tensorflow/python:quantized_conv_ops_test + \
//$1/tensorflow/python:saver_large_variable_test + \
//$1/tensorflow/python:saver_test + \
//$1/tensorflow/python:supervisor_test + \
//$1/tensorflow/python:sync_replicas_optimizer_test + \
//$1/tensorflow/python/debug:curses_ui_test + \
//$1/tensorflow/python/kernel_tests:as_string_op_test + \
//$1/tensorflow/python/kernel_tests:benchmark_test + \
//$1/tensorflow/python/kernel_tests:cast_op_test + \
//$1/tensorflow/python/kernel_tests:clip_ops_test + \
//$1/tensorflow/python/kernel_tests:conv_ops_test + \
//$1/tensorflow/python/kernel_tests:decode_image_op_test + \
//$1/tensorflow/python/kernel_tests:depthwise_conv_op_test + \
//$1/tensorflow/python/kernel_tests:functional_ops_test + \
//$1/tensorflow/python/kernel_tests:neon_depthwise_conv_op_test + \
//$1/tensorflow/python/kernel_tests:py_func_test + \
//$1/tensorflow/python/kernel_tests:rnn_test + \
//$1/tensorflow/python/kernel_tests:sets_test + \
//$1/tensorflow/python/kernel_tests:sparse_matmul_op_test + \
//$1/tensorflow/python/kernel_tests:string_to_number_op_test + \
//$1/tensorflow/python/kernel_tests:summary_ops_test + \
//$1/tensorflow/python/kernel_tests:variable_scope_test + \
//$1/tensorflow/python/tools:saved_model_cli_test + \
//$1/tensorflow/python/feature_column:feature_column_test + \
//$1/tensorflow/python/saved_model:saved_model_test \
"
}
function get_failing_gpu_py_tests() {
echo "
//$1/tensorflow/python/kernel_tests:diag_op_test + \
//$1/tensorflow/python/kernel_tests:one_hot_op_test + \
//$1/tensorflow/python/kernel_tests:rnn_test + \
//$1/tensorflow/python/kernel_tests:sets_test + \
//$1/tensorflow/python/kernel_tests:trace_op_test + \
$(get_failing_cpu_py_tests $1)
"
}
function clean_output_base() {
# TODO(pcloudy): bazel clean --expunge doesn't work on Windows yet.
# Clean the output base manually to ensure build correctness

View File

@ -58,12 +58,10 @@ create_python_test_dir "${PY_TEST_DIR}"
PIP_NAME=$(ls ${PY_TEST_DIR}/tensorflow-*.whl)
reinstall_tensorflow_pip ${PIP_NAME}
failing_cpu_py_tests=$(get_failing_cpu_py_tests ${PY_TEST_DIR})
passing_tests=$(bazel query "kind(py_test, //${PY_TEST_DIR}/tensorflow/python/...) - (${failing_cpu_py_tests})" |
# We need to strip \r so that the result could be store into a variable under MSYS
tr '\r' ' ')
# Define no_tensorflow_py_deps=true so that every py_test has no deps anymore,
# which will result testing system installed tensorflow
bazel test -c opt $BUILD_OPTS -k $passing_tests --define=no_tensorflow_py_deps=true --test_output=errors
bazel test -c opt $BUILD_OPTS -k --test_output=errors \
--define=no_tensorflow_py_deps=true --test_lang_filters=py \
--test_tag_filters=-no_pip,-no_windows \
--build_tag_filters=-no_pip,-no_windows --build_tests_only \
//${PY_TEST_DIR}/tensorflow/python/...

View File

@ -58,13 +58,11 @@ create_python_test_dir "${PY_TEST_DIR}"
PIP_NAME=$(ls ${PY_TEST_DIR}/tensorflow-*.whl)
reinstall_tensorflow_pip ${PIP_NAME}
failing_gpu_py_tests=$(get_failing_gpu_py_tests ${PY_TEST_DIR})
passing_tests=$(bazel query "kind(py_test, //${PY_TEST_DIR}/tensorflow/python/...) - (${failing_gpu_py_tests})" |
# We need to strip \r so that the result could be store into a variable under MSYS
tr '\r' ' ')
# Define no_tensorflow_py_deps=true so that every py_test has no deps anymore,
# which will result testing system installed tensorflow
# GPU tests are very flaky when running concurently, so set local_test_jobs=2
bazel test -c opt --config=win-cuda $BUILD_OPTS -k $passing_tests --define=no_tensorflow_py_deps=true --test_output=errors --local_test_jobs=2
# GPU tests are very flaky when running concurently, so set local_test_jobs=1
bazel test -c opt --config=win-cuda $BUILD_OPTS -k --test_output=errors \
--define=no_tensorflow_py_deps=true --test_lang_filters=py \
--test_tag_filters=-no_pip,-no_windows,-no_windows_gpu \
--build_tag_filters=-no_pip,-no_windows,-no_windows_gpu \
--local_test_jobs=1 --build_tests_only //${PY_TEST_DIR}/tensorflow/python/...