mirror of
https://github.com/zebrajr/tensorflow.git
synced 2026-01-15 12:15:41 +00:00
Let configure script set TF test options in bazelrc
PiperOrigin-RevId: 234881690
This commit is contained in:
committed by
TensorFlower Gardener
parent
a7015d8e1f
commit
fff6696b9f
30
configure.py
30
configure.py
@@ -1495,6 +1495,34 @@ def set_other_mpi_vars(environ_cp):
|
||||
'Cannot find the MPI library file in %s/lib or %s/lib64 or %s/lib32' %
|
||||
(mpi_home, mpi_home, mpi_home))
|
||||
|
||||
def system_specific_test_config(env):
|
||||
"""Add default test flags required for TF tests to bazelrc."""
|
||||
write_to_bazelrc('test --flaky_test_attempts=3')
|
||||
write_to_bazelrc('test --test_size_filters=small,medium')
|
||||
write_to_bazelrc(
|
||||
'test --test_tag_filters=-benchmark-test,-no_oss,-oss_serial')
|
||||
write_to_bazelrc('test --build_tag_filters=-benchmark-test,-no_oss')
|
||||
if is_windows():
|
||||
if env.get('TF_NEED_CUDA', None) == 1:
|
||||
write_to_bazelrc(
|
||||
'test --test_tag_filters=-no_windows,-no_windows_gpu,-no_gpu')
|
||||
write_to_bazelrc(
|
||||
'test --build_tag_filters=-no_windows,-no_windows_gpu,-no_gpu')
|
||||
else:
|
||||
write_to_bazelrc('test --test_tag_filters=-no_windows,-gpu')
|
||||
write_to_bazelrc('test --build_tag_filters=-no_windows,-gpu')
|
||||
elif is_macos():
|
||||
write_to_bazelrc('test --test_tag_filters=-gpu,-nomac,-no_mac')
|
||||
write_to_bazelrc('test --build_tag_filters=-gpu,-nomac,-no_mac')
|
||||
elif is_linux():
|
||||
if env.get('TF_NEED_CUDA', None) == 1:
|
||||
write_to_bazelrc('test --test_tag_filters=-no_gpu')
|
||||
write_to_bazelrc('test --build_tag_filters=-no_gpu')
|
||||
write_to_bazelrc('test --test_env=LD_LIBRARY_PATH')
|
||||
else:
|
||||
write_to_bazelrc('test --test_tag_filters=-gpu')
|
||||
write_to_bazelrc('test --build_tag_filters=-gpu')
|
||||
|
||||
|
||||
def set_system_libs_flag(environ_cp):
|
||||
syslibs = environ_cp.get('TF_SYSTEM_LIBS', '')
|
||||
@@ -1705,6 +1733,8 @@ def main():
|
||||
create_android_ndk_rule(environ_cp)
|
||||
create_android_sdk_rule(environ_cp)
|
||||
|
||||
system_specific_test_config(os.environ)
|
||||
|
||||
if get_var(
|
||||
environ_cp, 'TF_CONFIGURE_APPLE_BAZEL_RULES',
|
||||
'Configure Bazel rules for Apple platforms', False,
|
||||
|
||||
Reference in New Issue
Block a user