grpc/test/cpp/ext/csm
Yash Tibrewal a1535ae615 [CSM] Cleanup and test Size() on MeshLabelsIterable (#35769)
Adding testing for `Size()` on `MeshLabelsIterable` as promised on https://github.com/grpc/grpc/pull/35371

This method doesn't get used the OTel C++ library at present so it was untested earlier, and bugs in its implementation were noticed later. To avoid that issue in the future, adding manual testing of this method.

Changes -
* Moved `MeshLabelsIterable` to the header to be able to test its Size method directly. Also had to move around some internals to be able to do so.
* Replaced `absl::variant<grpc_core::Slice, StructPb> metadata_` from decoding the metadata lazily to just decoding it in the constructor. I don't remember the original thinking behind this. Maybe I wanted the decoding to happen lazily, but there doesn't seem to be much gain from doing it lazily, we instead have to deal with the overhead of `variant`.

Closes #35769

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35769 from yashykt:CsmMeshLabelsIterableSizeTesting ec9033b742
PiperOrigin-RevId: 617901839
2024-03-21 11:06:08 -07:00
..
BUILD [OTel] Add a PluginOption API (#35434) 2024-01-09 18:28:43 +00:00
csm_observability_test.cc [CSM] De-experimentalize CsmObservability API (#35836) 2024-02-09 09:28:18 -08:00
mesh_id_test.cc [OTel and Csm] Cosmetic API changes (#34294) 2023-09-11 12:23:45 -07:00
metadata_exchange_test.cc [CSM] Cleanup and test Size() on MeshLabelsIterable (#35769) 2024-03-21 11:06:08 -07:00