Ask questionsFailed to run the unit test of bonus_tests
<em>Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em>
You can collect some of this information using our environment capture
You can also obtain the TensorFlow version with: 1. TF 1.0:
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0:
python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"
Describe the current behavior After build from source code:
bazel --output_user_root=$build_dir build --config=v2 //tensorflow/tools/pip_package:build_pip_package
I run the unit test:
bazel --output_user_root=$build_dir test //tensorflow/core/kernels:bonus_tests
It failed with the error message:
ERROR: no such target '//tensorflow/core/kernels:bonus_tests': target 'bonus_tests' not declared in package 'tensorflow/core/kernels' (did you mean 'loss_test'?) defined by /home/lesliefang/debug_failrunbonus_tests/tensorflow/tensorflow/core/kernels/BUILD INFO: Elapsed time: 0.382s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded) FAILED: Build did NOT complete successfully (0 packages loaded)
Describe the expected behavior The unit test should run successfully.
Code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. As the description above.
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
Answer questions akuegel
The name of the tf_cc_tests rule is never used to create an executable. If you check the definition, it creates executable tests for each of the entries in srcs (their name derived from name of their source file). So you can for example run: bazel --output_user_root=$build_dir test //tensorflow/core/kernels:adjust_contrast_op_test (this is the first of the created tests from the bonus_tests target).