5

I'd like to run selected tests from Tensor Flow unit tests using bazel, but I cannot get good enough granularity.

For example I am interested in running test SessionClusterSpecPropagationTest.testFullDeviceNames from //tensorflow/tools/graph_transforms:transform_graph_py_test

I figured out so far I can run bazel test -c opt //tensorflow/tools/graph_transforms:transform_graph_py_test, but unfortunately, this is running all of the tests from this gtest.

Regular --gtest_filter is not working. I also tried --test_filter=SessionClusterSpecPropagationTest.testFullDeviceNames, but I couldn't run single test either.

Could someone please recommend how to run it properly?

sebap123
  • 2,541
  • 6
  • 45
  • 81

1 Answers1

0

You can refer this for Tensorflow test cases. This are the best practises. You should try running bazel test for executing the test cases.

# All tests (for C++ changes).
$ bazel test //tensorflow/...

# All Python tests (for Python front-end changes).
$ bazel test //tensorflow/python/...

# All tests (with GPU support).
$ bazel test -c opt --config=cuda //tensorflow/...
$ bazel test -c opt --config=cuda //tensorflow/python/...

For more reference : Run Tensorflow unit tests

SG_Bazel
  • 343
  • 2
  • 7