Repository navigation
Fix TF-Text C++ tests in OSS Bazel builds - #1578
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_1009180430
branch
4 times, most recently
from
October 30, 2026 18:52
65ff225 to
e248921
Compare
- Add `tf_cc_test` and `tflite_cc_test` wrapper macros (forwarding `**kwargs`) to `tftext.bzl` (which adds `if_cuda` and `tf_opts_nortti_if_mobile()` `copts`) and `oss_scripts/tftext.bzl.oss` so `tf_cc_test` links against the prebuilt `@release_or_nightly//:tensorflow_libtensorflow_framework` and `@release_or_nightly//:tensorflow_tf_header_lib` instead of recompiling `@org_tensorflow//tensorflow/core/...` from source, while `tflite_cc_test` links the prebuilt framework alongside TFLite test support built from `@org_tensorflow`. - Export `shape_inference_testutil.cc` in `tensorflow.shim_sources.patch` and add an `includes` argument on OSS `tf_cc_library` so `tf_cc_test` targets (including op and kernel shape inference tests) can compile `shape_inference_testutil.cc` against `@release_or_nightly//:tensorflow_tf_header_lib` via a package-local staged include directory without putting `@org_tensorflow` ahead of `@release_or_nightly` on the `-iquote` path. Also scope `:shape_inference_testutil_oss` to tests that depend on `shape_inference_testutil`. - Update `copy.bara.sky` to transform `attr_value.proto.h` <-> `attr_value.pb.h`, map `//third_party/absl/status:status_matchers` <-> `@com_google_absl//absl/status:status_matchers`, and fix test data file path replacements. - Replace `testing::status::StatusIs` with `absl_testing::StatusIs` (from `absl/status/status_matchers.h`), replace `.ValueOrDie()` with `.value()`, provide an `ASSERT_OK_AND_ASSIGN` fallback macro (extracted into `core/kernels/test_status_macros.h`) for OSS builds, switch SentencePiece tests from `sentencepiece.proto.h` to `sentencepiece.pb.h` and cwd-relative test-data paths read in binary mode via `StdReadFileToString`, and remove unused `tensorflow/core/framework/tensor_testutil.h` includes. PiperOrigin-RevId: 1009180430
copybara-service
Bot
force-pushed
the
test_1009180430
branch
from
October 30, 2026 21:10
e248921 to
f7bbd43
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix TF-Text C++ tests in OSS Bazel builds
tf_cc_testandtflite_cc_testwrapper macros (forwarding**kwargs) totftext.bzl(which addsif_cudaandtf_opts_nortti_if_mobile()copts) andoss_scripts/tftext.bzl.osssotf_cc_testlinks against the prebuilt@release_or_nightly//:tensorflow_libtensorflow_frameworkand@release_or_nightly//:tensorflow_tf_header_libinstead of recompiling@org_tensorflow//tensorflow/core/...from source, whiletflite_cc_testlinks the prebuilt framework alongside TFLite test support built from@org_tensorflow.shape_inference_testutil.ccintensorflow.shim_sources.patchand add anincludesargument on OSStf_cc_librarysotf_cc_testtargets (including op and kernel shape inference tests) can compileshape_inference_testutil.ccagainst@release_or_nightly//:tensorflow_tf_header_libvia a package-local staged include directory without putting@org_tensorflowahead of@release_or_nightlyon the-iquotepath. Also scope:shape_inference_testutil_ossto tests that depend onshape_inference_testutil.copy.bara.skyto transformattr_value.proto.h<->attr_value.pb.h, map//third_party/absl/status:status_matchers<->@com_google_absl//absl/status:status_matchers, and fix test data file path replacements.testing::status::StatusIswithabsl_testing::StatusIs(fromabsl/status/status_matchers.h), replace.ValueOrDie()with.value(), provide anASSERT_OK_AND_ASSIGNfallback macro (extracted intocore/kernels/test_status_macros.h) for OSS builds, switch SentencePiece tests fromsentencepiece.proto.htosentencepiece.pb.hand cwd-relative test-data paths read in binary mode viaStdReadFileToString, and remove unusedtensorflow/core/framework/tensor_testutil.hincludes.