From 226e6fabaa9e147dbc0c3f1edb2d6fb9b329315b Mon Sep 17 00:00:00 2001 From: Michael Case Date: Thu, 27 Dec 2018 13:29:45 -0800 Subject: [PATCH] Change instances of py_test to tf_py_test in python/BUILD. PiperOrigin-RevId: 227057949 --- tensorflow/python/BUILD | 653 +++++++++++++++++--------------------- tensorflow/tensorflow.bzl | 3 +- 2 files changed, 288 insertions(+), 368 deletions(-) diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 9c508651646..7503c899aa1 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -494,19 +494,11 @@ tf_cc_shared_object( ], ) -py_test( +tf_py_test( name = "file_system_test", size = "small", srcs = ["framework/file_system_test.py"], - data = [":framework/test_file_system.so"], - main = "framework/file_system_test.py", - srcs_version = "PY2AND3", - tags = [ - "no_pip", # Path issues due to test environment - "no_windows", - "notap", - ], - deps = [ + additional_deps = [ ":client_testlib", ":data_flow_ops", ":framework", @@ -515,57 +507,59 @@ py_test( ":platform", ":util", ], + data = [":framework/test_file_system.so"], + main = "framework/file_system_test.py", + tags = [ + "no_pip", # Path issues due to test environment + "no_windows", + "notap", + ], ) -py_test( +tf_py_test( name = "decorator_utils_test", srcs = ["util/decorator_utils_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":platform", ":util", ], ) -py_test( +tf_py_test( name = "tf_export_test", srcs = ["util/tf_export_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":platform", ":util", ], ) -py_test( +tf_py_test( name = "deprecation_test", srcs = ["util/deprecation_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":platform", ":util", ], ) -py_test( +tf_py_test( name = "dispatch_test", srcs = ["util/dispatch_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":platform", ":util", ], ) -py_test( +tf_py_test( name = "keyword_args_test", srcs = ["util/keyword_args_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], @@ -812,13 +806,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "function_def_to_graph_test", size = "small", srcs = ["framework/function_def_to_graph_test.py"], - srcs_version = "PY2AND3", - tags = ["no_pip"], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":constant_op", @@ -830,6 +822,7 @@ py_test( ":math_ops", ":test_ops", ], + tags = ["no_pip"], ) py_library( @@ -940,12 +933,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "auto_control_deps_test", size = "small", srcs = ["framework/auto_control_deps_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":auto_control_deps", ":client_testlib", ], @@ -980,12 +972,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "smart_cond_test", size = "small", srcs = ["framework/smart_cond_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":constant_op", ":framework_ops", @@ -1133,52 +1124,47 @@ py_library( ], ) -py_test( +tf_py_test( name = "framework_registry_test", size = "small", srcs = ["framework/registry_test.py"], - main = "framework/registry_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", "//tensorflow/python:client_testlib", ], + main = "framework/registry_test.py", ) -py_test( +tf_py_test( name = "framework_errors_test", size = "small", srcs = ["framework/errors_test.py"], - main = "framework/errors_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":errors", "//tensorflow/core:protos_all_py", ], + main = "framework/errors_test.py", ) -py_test( +tf_py_test( name = "framework_error_interpolation_test", size = "small", srcs = ["framework/error_interpolation_test.py"], - main = "framework/error_interpolation_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":constant_op", ":error_interpolation", ":traceable_stack", ], + main = "framework/error_interpolation_test.py", ) -py_test( +tf_py_test( name = "framework_subscribe_test", size = "small", srcs = ["framework/subscribe_test.py"], - main = "framework/subscribe_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework", ":framework_for_generated_wrappers", ":framework_test_lib", @@ -1187,50 +1173,48 @@ py_test( ":script_ops", ":subscribe", ], + main = "framework/subscribe_test.py", ) -py_test( +tf_py_test( name = "contrib_test", size = "small", srcs = ["framework/contrib_test.py"], - main = "framework/contrib_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ "//tensorflow:tensorflow_py", "//tensorflow/python:client_testlib", ], + main = "framework/contrib_test.py", ) -py_test( +tf_py_test( name = "build_info_test", size = "small", srcs = [ "platform/build_info.py", "platform/build_info_test.py", ], + additional_deps = [ + ":client_testlib", + ":platform", + ], main = "platform/build_info_test.py", - srcs_version = "PY2AND3", tags = [ "no_pip", "notap", ], - deps = [ - ":client_testlib", - ":platform", - ], ) -py_test( +tf_py_test( name = "proto_test", size = "small", srcs = ["framework/proto_test.py"], - main = "framework/proto_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", "//third_party/py/numpy", ], + main = "framework/proto_test.py", ) tf_gen_op_wrapper_private_py( @@ -1293,25 +1277,22 @@ cuda_py_tests( ], ) -py_test( +tf_py_test( name = "framework_versions_test", size = "small", srcs = ["framework/versions_test.py"], - main = "framework/versions_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ], + main = "framework/versions_test.py", ) -py_test( +tf_py_test( name = "framework_importer_test", size = "large", srcs = ["framework/importer_test.py"], - main = "framework/importer_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework", @@ -1323,9 +1304,10 @@ py_test( ":random_ops", ":test_ops", ":variables", - "//tensorflow/core:protos_all_py", "//third_party/py/numpy", + "//tensorflow/core:protos_all_py", ], + main = "framework/importer_test.py", ) filegroup( @@ -1336,18 +1318,11 @@ filegroup( visibility = ["//visibility:public"], ) -py_test( +tf_py_test( name = "framework_meta_graph_test", size = "small", srcs = ["framework/meta_graph_test.py"], - data = ["//tensorflow/python:meta_graph_testdata"], - main = "framework/meta_graph_test.py", - srcs_version = "PY2AND3", - tags = [ - "no_pip", - "no_windows", - ], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":control_flow_ops", @@ -1362,21 +1337,26 @@ py_test( ":training", ":variables", ], + data = ["//tensorflow/python:meta_graph_testdata"], + main = "framework/meta_graph_test.py", + tags = [ + "no_pip", + "no_windows", + ], ) -py_test( +tf_py_test( name = "framework_traceable_stack_test", size = "small", srcs = ["framework/traceable_stack_test.py"], - main = "framework/traceable_stack_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_test_lib", ":platform_test", ":test_ops", ":traceable_stack", ":util", ], + main = "framework/traceable_stack_test.py", ) tf_gen_op_wrapper_py( @@ -1411,29 +1391,25 @@ cc_library( alwayslink = 1, ) -py_test( +tf_py_test( name = "framework_common_shapes_test", size = "small", srcs = ["framework/common_shapes_test.py"], - main = "framework/common_shapes_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework", ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", "//tensorflow/core:protos_all_py", ], + main = "framework/common_shapes_test.py", ) -py_test( +tf_py_test( name = "framework_ops_test", size = "small", srcs = ["framework/ops_test.py"], - main = "framework/ops_test.py", - srcs_version = "PY2AND3", - tags = ["no_pip"], # test_ops_2 is not available in pip. - deps = [ + additional_deps = [ ":cond_v2", ":control_flow_ops", ":errors", @@ -1454,114 +1430,106 @@ py_test( "//tensorflow/python/eager:context", "//tensorflow/python/eager:function", ], + main = "framework/ops_test.py", + tags = ["no_pip"], # test_ops_2 is not available in pip. ) -py_test( +tf_py_test( name = "framework_ops_enable_eager_test", size = "small", srcs = ["framework/ops_enable_eager_test.py"], - main = "framework/ops_enable_eager_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework", ":platform_test", "//tensorflow/python/eager:context", ], + main = "framework/ops_enable_eager_test.py", ) -py_test( +tf_py_test( name = "framework_tensor_shape_test", size = "small", srcs = ["framework/tensor_shape_test.py"], - main = "framework/tensor_shape_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", "//tensorflow/core:protos_all_py", ], + main = "framework/tensor_shape_test.py", ) -py_test( +tf_py_test( name = "framework_tensor_spec_test", size = "small", srcs = ["framework/tensor_spec_test.py"], - main = "framework/tensor_spec_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", ":tensor_spec", "//third_party/py/numpy", ], + main = "framework/tensor_spec_test.py", ) -py_test( +tf_py_test( name = "framework_sparse_tensor_test", size = "small", srcs = ["framework/sparse_tensor_test.py"], - main = "framework/sparse_tensor_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework", ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", "//tensorflow/core:protos_all_py", ], + main = "framework/sparse_tensor_test.py", ) -py_test( +tf_py_test( name = "framework_device_test", size = "small", srcs = ["framework/device_test.py"], - main = "framework/device_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", "//tensorflow/core:protos_all_py", ], + main = "framework/device_test.py", ) -py_test( +tf_py_test( name = "framework_random_seed_test", size = "small", srcs = ["framework/random_seed_test.py"], - main = "framework/random_seed_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework", ], + main = "framework/random_seed_test.py", ) -py_test( +tf_py_test( name = "framework_tensor_shape_div_test", size = "small", srcs = ["framework/tensor_shape_div_test.py"], - main = "framework/tensor_shape_div_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", - "//tensorflow/core:protos_all_py", "@six_archive//:six", + "//tensorflow/core:protos_all_py", ], + main = "framework/tensor_shape_div_test.py", ) -py_test( +tf_py_test( name = "framework_tensor_util_test", size = "small", srcs = ["framework/tensor_util_test.py"], - main = "framework/tensor_util_test.py", - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework", @@ -1571,16 +1539,15 @@ py_test( ":state_ops_gen", "//third_party/py/numpy", ], + main = "framework/tensor_util_test.py", + tags = ["no_windows"], ) -py_test( +tf_py_test( name = "framework_test_util_test", size = "small", srcs = ["framework/test_util_test.py"], - main = "framework/test_util_test.py", - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":control_flow_ops", ":errors", ":framework_for_generated_wrappers", @@ -1591,35 +1558,35 @@ py_test( ":session", ":test_ops", ":variables", + "@absl_py//absl/testing:parameterized", + "//third_party/py/numpy", "//tensorflow/core:protos_all_py", "//tensorflow/python/eager:context", - "//third_party/py/numpy", - "@absl_py//absl/testing:parameterized", ], + main = "framework/test_util_test.py", + tags = ["no_windows"], ) -py_test( +tf_py_test( name = "framework_dtypes_test", size = "small", srcs = ["framework/dtypes_test.py"], - main = "framework/dtypes_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", + "//third_party/py/numpy", "//tensorflow:tensorflow_py", "//tensorflow/core:protos_all_py", - "//third_party/py/numpy", ], + main = "framework/dtypes_test.py", ) -py_test( +tf_py_test( name = "op_def_library_test", size = "small", srcs = ["framework/op_def_library_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_for_generated_wrappers", ":framework_test_lib", ":platform_test", @@ -1627,18 +1594,17 @@ py_test( ], ) -py_test( +tf_py_test( name = "framework_kernels_test", size = "small", srcs = ["framework/kernels_test.py"], - main = "framework/kernels_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":framework_test_lib", ":kernels", ":platform_test", ":test_ops", ], + main = "framework/kernels_test.py", ) tf_gen_op_wrapper_private_py( @@ -2081,12 +2047,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "clip_ops_test", size = "small", srcs = ["ops/clip_ops_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":clip_ops", ":framework_for_generated_wrappers", @@ -2104,12 +2069,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "collective_ops_test", size = "small", srcs = ["ops/collective_ops_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":collective_ops", ":framework_for_generated_wrappers", @@ -2904,11 +2868,10 @@ py_library( ], ) -py_test( +tf_py_test( name = "sparse_ops_test", srcs = ["ops/sparse_ops_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":constant_op", ":dtypes", ":framework_test_lib", @@ -2931,11 +2894,10 @@ py_library( ], ) -py_test( +tf_py_test( name = "sort_ops_test", srcs = ["ops/sort_ops_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework", @@ -3735,17 +3697,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "evaluation_test", size = "small", srcs = ["training/evaluation_test.py"], - shard_count = 3, - srcs_version = "PY2AND3", - tags = [ - "manual", - "notap", # Disabling until b/33000128 and b/33040312 are fixed. - ], - deps = [ + additional_deps = [ ":array_ops", ":client", ":client_testlib", @@ -3760,9 +3716,14 @@ py_test( ":summary", ":training", ":variables", + "//third_party/py/numpy", "//tensorflow/core:protos_all_py", "//tensorflow/python/ops/losses", - "//third_party/py/numpy", + ], + shard_count = 3, + tags = [ + "manual", + "notap", # Disabling until b/33000128 and b/33040312 are fixed. ], ) @@ -3810,76 +3771,68 @@ py_library( ) # Placeholder for intenal nest_test comments. -py_test( +tf_py_test( name = "util_nest_test", size = "small", srcs = ["util/nest_test.py"], - main = "util/nest_test.py", - srcs_version = "PY2AND3", - visibility = visibility + [ - ], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework", ":framework_for_generated_wrappers", ":math_ops", ":util", - "//third_party/py/numpy", "@absl_py//absl/testing:parameterized", + "//third_party/py/numpy", ], + main = "util/nest_test.py", ) -py_test( +tf_py_test( name = "util_serialization_test", size = "small", srcs = ["util/serialization_test.py"], - main = "util/serialization_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], + main = "util/serialization_test.py", ) -py_test( +tf_py_test( name = "future_api_test", size = "small", srcs = ["util/future_api_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":util", "//tensorflow:tensorflow_py", ], ) -py_test( +tf_py_test( name = "function_utils_test", srcs = ["util/function_utils_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], ) -py_test( +tf_py_test( name = "tf_contextlib_test", size = "small", srcs = ["util/tf_contextlib_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], ) -py_test( +tf_py_test( name = "tf_decorator_test", size = "small", srcs = ["util/tf_decorator_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], @@ -3897,23 +3850,21 @@ py_library( ], ) -py_test( +tf_py_test( name = "tf_should_use_test", size = "small", srcs = ["util/tf_should_use_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":tf_should_use", ], ) -py_test( +tf_py_test( name = "tf_inspect_test", size = "small", srcs = ["util/tf_inspect_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", ], @@ -3931,17 +3882,16 @@ py_library( ], ) -py_test( +tf_py_test( name = "lock_util_test", size = "small", srcs = ["util/lock_util_test.py"], - main = "util/lock_util_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":util", "@absl_py//absl/testing:parameterized", ], + main = "util/lock_util_test.py", ) tf_proto_library( @@ -3970,28 +3920,25 @@ tf_proto_library( visibility = ["//tensorflow:internal"], ) -py_test( +tf_py_test( name = "protobuf_compare_test", size = "small", srcs = ["util/protobuf/compare_test.py"], - main = "util/protobuf/compare_test.py", - srcs_version = "PY2AND3", - tags = ["no_pip"], # compare_test_pb2 proto is not available in pip. - deps = [ + additional_deps = [ ":compare_test_proto_py", ":platform_test", ":util", "@six_archive//:six", ], + main = "util/protobuf/compare_test.py", + tags = ["no_pip"], # compare_test_pb2 proto is not available in pip. ) -py_test( +tf_py_test( name = "util_example_parser_configuration_test", size = "small", srcs = ["util/example_parser_configuration_test.py"], - main = "util/example_parser_configuration_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client", ":client_testlib", @@ -3999,14 +3946,14 @@ py_test( ":parsing_ops", ":util_example_parser_configuration", ], + main = "util/example_parser_configuration_test.py", ) -py_test( +tf_py_test( name = "events_writer_test", size = "small", srcs = ["client/events_writer_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":errors", ":framework_test_lib", ":lib", @@ -4621,24 +4568,22 @@ cuda_py_test( tags = ["no_windows_gpu"], ) -py_test( +tf_py_test( name = "c_api_util_test", size = "small", srcs = ["framework/c_api_util_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":c_api_util", ":framework_test_lib", ":platform_test", ], ) -py_test( +tf_py_test( name = "graph_util_test", size = "small", srcs = ["framework/graph_util_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client", ":client_testlib", ":framework", @@ -4651,37 +4596,34 @@ py_test( ], ) -py_test( +tf_py_test( name = "bfloat16_test", size = "small", srcs = ["lib/core/bfloat16_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":lib", ":pywrap_tensorflow", ], ) -py_test( +tf_py_test( name = "file_io_test", size = "small", srcs = ["lib/io/file_io_test.py"], - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":client_testlib", ":errors", ":lib", ], + tags = ["no_windows"], ) -py_test( +tf_py_test( name = "tf_record_test", size = "small", srcs = ["lib/io/tf_record_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":errors", ":lib", @@ -4871,17 +4813,11 @@ cuda_py_test( ], ) -py_test( +tf_py_test( name = "saver_large_variable_test", size = "medium", srcs = ["training/saver_large_variable_test.py"], - srcs_version = "PY2AND3", - tags = [ - "manual", - "noasan", # http://b/30379628 - "notsan", # http://b/30379628 - ], - deps = [ + additional_deps = [ ":client", ":client_testlib", ":errors", @@ -4890,18 +4826,18 @@ py_test( ":variables", "//tensorflow/core:protos_all_py", ], + tags = [ + "manual", + "noasan", # http://b/30379628 + "notsan", # http://b/30379628 + ], ) -py_test( +tf_py_test( name = "saver_large_partitioned_variable_test", size = "medium", srcs = ["training/saver_large_partitioned_variable_test.py"], - srcs_version = "PY2AND3", - tags = [ - "noasan", # http://b/30782289 - "notsan", # http://b/30782289 - ], - deps = [ + additional_deps = [ ":client", ":client_testlib", ":framework_for_generated_wrappers", @@ -4909,6 +4845,10 @@ py_test( ":training", ":variables", ], + tags = [ + "noasan", # http://b/30782289 + "notsan", # http://b/30782289 + ], ) cuda_py_test( @@ -4954,16 +4894,11 @@ tf_py_test( tags = ["no_windows"], ) -py_test( +tf_py_test( name = "basic_session_run_hooks_test", size = "medium", srcs = ["training/basic_session_run_hooks_test.py"], - srcs_version = "PY2AND3", - tags = [ - "no_windows", - "notsan", # intermittent races on a few percent of runs - ], - deps = [ + additional_deps = [ ":client", ":client_testlib", ":control_flow_ops", @@ -4980,21 +4915,17 @@ py_test( "//tensorflow/contrib/testing:testing_py", "//tensorflow/core:protos_all_py", ], + tags = [ + "no_windows", + "notsan", # intermittent races on a few percent of runs + ], ) -py_test( +tf_py_test( name = "checkpoint_utils_test", size = "small", srcs = ["training/checkpoint_utils_test.py"], - srcs_version = "PY2AND3", - tags = [ - "manual", - "no_cuda_on_cpu_tap", - "no_oss", - "no_windows", - "notap", - ], - deps = [ + additional_deps = [ ":client", ":client_testlib", ":framework_for_generated_wrappers", @@ -5008,14 +4939,20 @@ py_test( ":variable_scope", ":variables", ], + tags = [ + "manual", + "no_cuda_on_cpu_tap", + "no_oss", + "no_windows", + "notap", + ], ) -py_test( +tf_py_test( name = "checkpoint_ops_test", size = "small", srcs = ["training/checkpoint_ops_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":checkpoint_ops_gen", ":client", ":client_testlib", @@ -5031,12 +4968,11 @@ py_test( ], ) -py_test( +tf_py_test( name = "warm_starting_util_test", size = "medium", srcs = ["training/warm_starting_util_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":dtypes", @@ -5045,21 +4981,16 @@ py_test( ":training", ":variable_scope", ":variables", - "//tensorflow/python/feature_column:feature_column_py", "//third_party/py/numpy", + "//tensorflow/python/feature_column:feature_column_py", ], ) -py_test( +tf_py_test( name = "monitored_session_test", size = "medium", srcs = ["training/monitored_session_test.py"], - srcs_version = "PY2AND3", - tags = [ - "no_pip", - "notsan", # b/67945581 - ], - deps = [ + additional_deps = [ ":array_ops", ":checkpoint_management", ":client_testlib", @@ -5078,6 +5009,10 @@ py_test( "//tensorflow/core:protos_all_py", "//tensorflow/python/distribute:distribute_coordinator", ], + tags = [ + "no_pip", + "notsan", # b/67945581 + ], ) py_library( @@ -5099,12 +5034,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "training_util_test", size = "small", srcs = ["training/training_util_test.py"], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework", ":platform", @@ -5271,13 +5205,11 @@ py_library( ], ) -py_test( +tf_py_test( name = "layers_base_test", size = "small", srcs = ["layers/base_test.py"], - main = "layers/base_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", @@ -5290,15 +5222,14 @@ py_test( ":variable_scope", "//tensorflow/python/eager:context", ], + main = "layers/base_test.py", ) -py_test( +tf_py_test( name = "layers_core_test", size = "small", srcs = ["layers/core_test.py"], - main = "layers/core_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", @@ -5311,15 +5242,14 @@ py_test( ":variables", "//third_party/py/numpy", ], + main = "layers/core_test.py", ) -py_test( +tf_py_test( name = "layers_convolutional_test", size = "small", srcs = ["layers/convolutional_test.py"], - main = "layers/convolutional_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ":framework_test_lib", @@ -5328,32 +5258,31 @@ py_test( ":nn_ops", ":random_ops", ], + main = "layers/convolutional_test.py", ) -py_test( +tf_py_test( name = "layers_utils_test", size = "small", srcs = ["layers/utils_test.py"], - main = "layers/utils_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":layers", ], + main = "layers/utils_test.py", ) -py_test( +tf_py_test( name = "layers_pooling_test", size = "small", srcs = ["layers/pooling_test.py"], - main = "layers/pooling_test.py", - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":framework_test_lib", ":layers", ":random_ops", ], + main = "layers/pooling_test.py", ) cuda_py_test( @@ -5378,46 +5307,43 @@ cuda_py_test( # ----------------------------------------------------------------------------- # Quantization -py_test( +tf_py_test( name = "dequantize_op_test", size = "small", srcs = ["ops/dequantize_op_test.py"], - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", "//third_party/py/numpy", ], + tags = ["no_windows"], ) -py_test( +tf_py_test( name = "quantized_ops_test", size = "small", srcs = ["ops/quantized_ops_test.py"], - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", "//third_party/py/numpy", ], + tags = ["no_windows"], ) -py_test( +tf_py_test( name = "quantized_conv_ops_test", size = "small", srcs = ["ops/quantized_conv_ops_test.py"], - srcs_version = "PY2AND3", - tags = ["no_windows"], - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ":nn_ops", "//third_party/py/numpy", ], + tags = ["no_windows"], ) cuda_py_test( @@ -5632,38 +5558,32 @@ py_library( ], ) -py_test( +tf_py_test( name = "item_test", size = "small", srcs = [ "grappler/item_test.py", ], - srcs_version = "PY2AND3", - tags = [ - "grappler", - "no_pip", # tf_optimizer is not available in pip. - ], - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ":math_ops", ":tf_item", "//tensorflow/core:protos_all_py", ], + tags = [ + "grappler", + "no_pip", # tf_optimizer is not available in pip. + ], ) -py_test( +tf_py_test( name = "datasets_test", size = "small", srcs = [ "grappler/datasets_test.py", ], - srcs_version = "PY2AND3", - tags = [ - "grappler", - "no_pip", # tf_optimizer is not available in pip. - ], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", @@ -5671,6 +5591,10 @@ py_test( "//tensorflow/core:protos_all_py", "//tensorflow/python/data", ], + tags = [ + "grappler", + "no_pip", # tf_optimizer is not available in pip. + ], ) py_library( @@ -5719,25 +5643,24 @@ py_library( ], ) -py_test( +tf_py_test( name = "tf_optimizer_test", size = "small", srcs = [ "grappler/tf_optimizer_test.py", ], - srcs_version = "PY2AND3", - tags = [ - "grappler", - "no_pip", # tf_optimizer is not available in pip. - ], - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ":math_ops", ":tf_item", ":tf_optimizer", - "//tensorflow/core:protos_all_py", "//third_party/py/numpy", + "//tensorflow/core:protos_all_py", + ], + tags = [ + "grappler", + "no_pip", # tf_optimizer is not available in pip. ], ) @@ -5754,32 +5677,28 @@ py_library( ], ) -py_test( +tf_py_test( name = "graph_placer_test", size = "large", srcs = ["grappler/graph_placer_test.py"], - tags = [ - "grappler", - "no_pip", # graph_placer is not available in pip. - ], - deps = [ + additional_deps = [ ":client_testlib", ":graph_placer", "//tensorflow/python:math_ops", ], + tags = [ + "grappler", + "no_pip", # graph_placer is not available in pip. + ], ) -py_test( +tf_py_test( name = "memory_optimizer_test", size = "medium", srcs = [ "grappler/memory_optimizer_test.py", ], - srcs_version = "PY2AND3", - tags = [ - "grappler", - ], - deps = [ + additional_deps = [ ":client_testlib", ":framework_for_generated_wrappers", ":math_ops", @@ -5790,8 +5709,11 @@ py_test( ":training", ":variable_scope", ":variables", - "//tensorflow/core:protos_all_py", "//third_party/py/numpy", + "//tensorflow/core:protos_all_py", + ], + tags = [ + "grappler", ], ) @@ -5876,17 +5798,11 @@ py_binary( ], ) -py_test( +tf_py_test( name = "cost_analyzer_test", size = "small", srcs = ["grappler/cost_analyzer_test.py"], - srcs_version = "PY2AND3", - tags = [ - "grappler", - "no_cuda_on_cpu_tap", - "no_pip", - ], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":cost_analyzer", @@ -5898,8 +5814,13 @@ py_test( ":state_ops", ":training", ":variables", - "//tensorflow/core:protos_all_py", "//third_party/py/numpy", + "//tensorflow/core:protos_all_py", + ], + tags = [ + "grappler", + "no_cuda_on_cpu_tap", + "no_pip", ], ) @@ -5912,24 +5833,23 @@ py_library( deps = [":pywrap_tensorflow_internal"], ) -py_test( +tf_py_test( name = "model_analyzer_test", size = "small", srcs = ["grappler/model_analyzer_test.py"], - srcs_version = "PY2AND3", - tags = [ - "grappler", - "no_pip", - ], - deps = [ + additional_deps = [ ":array_ops", ":client_testlib", ":framework_for_generated_wrappers", ":math_ops", ":model_analyzer", ":state_ops", - "//tensorflow/core:protos_all_py", "//third_party/py/numpy", + "//tensorflow/core:protos_all_py", + ], + tags = [ + "grappler", + "no_pip", ], ) @@ -5998,14 +5918,13 @@ py_library( ], ) -py_test( +tf_py_test( name = "mode_keys_test", size = "small", srcs = [ "training/mode_keys_test.py", ], - srcs_version = "PY2AND3", - deps = [ + additional_deps = [ ":client_testlib", ":mode_keys", ], diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index fbdfa2cf6dd..1024b686ebd 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -1793,6 +1793,7 @@ def tf_py_test( tags = [], shard_count = 1, additional_deps = [], + additional_visibility = [], kernels = [], flaky = 0, xla_enabled = False, @@ -1813,7 +1814,7 @@ def tf_py_test( shard_count = shard_count, srcs_version = "PY2AND3", tags = tags, - visibility = [clean_dep("//tensorflow:internal")], + visibility = [clean_dep("//tensorflow:internal")] + additional_visibility, deps = [ clean_dep("//tensorflow/python:extra_py_tests_deps"), clean_dep("//tensorflow/python:gradient_checker"),