test: got the client_integration_test moved over to the builder.#2362
test: got the client_integration_test moved over to the builder.#2362alyssawilk merged 14 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
|
@goaway I expect this to fail CI as I haven't gotten the RTDS test passing yet, but client integration test is good to go and there's a lot of moving parts here I'd like your thoughts on, especially the weirdness of taking config from the builder, using it to initialize the integration test config helper, then serializing the config helper back to the builder so we can test custom configs. thanks! |
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
library/cc/stream.h
Outdated
|
|
||
| Stream& sendHeaders(RequestHeadersSharedPtr headers, bool end_stream); | ||
| Stream& sendData(envoy_data data); | ||
| Stream& sendData(envoy_data data, bool end_stream); |
There was a problem hiding this comment.
IIRC the reason end_stream is missing here was the "fluent"/chained interface design: one would call close(envoy data data) to pass a final data frame, and that in turn would return void instead of a reference to a now-closed stream, finishing off the chain.
I think we can reconsider whether that design actually makes sense here, but for now it's probably worth keeping the iOS/Android/C++ interfaces in alignment.
There was a problem hiding this comment.
but doesn't sendHeaders with end stream implicitly close? That's a pretty weird abstraction IMO but yeah this PR is not the place to change it.
|
Discussed a bit over Slack. Overall this seems fine to me, though at least on a case-by-case basis I think it's worth considering whether a given override might simply make sense as a Builder option. I'll also be thinking over possibilities for allowing for direct overrides - at least on C++ - rather than needing to do the serialization ahead of time and passing that back through. |
|
ok as discussed, moved the default to "use builder config" but I don't think we want to block this PR on builder RTDS support. |
| // EnvoyStringAccessor): EngineBuilder { | ||
| protected: | ||
| void setOverrideConfigForTests(std::string config) { config_override_for_tests_ = config; } | ||
| void setAdminAddressPathForTests(std::string admin) { admin_address_path_for_tests_ = admin; } |
There was a problem hiding this comment.
alternately could publicly add key-value and hash map for generic command line override.
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
| return *this; | ||
| } | ||
|
|
||
| RequestHeadersBuilder& RequestHeadersBuilder::addKeyValue(std::string key, std::string value) { |
There was a problem hiding this comment.
nit: I'd call thisset, for alignment with the other builders: https://github.com/envoyproxy/envoy-mobile/blob/main/library/kotlin/io/envoyproxy/envoymobile/RequestHeadersBuilder.kt#L43
goaway
left a comment
There was a problem hiding this comment.
One minor nit, but otherwise LGTM. Thanks @alyssawilk!
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
jpsim
left a comment
There was a problem hiding this comment.
Yay, one more up to date API!
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
followup to #2362 Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Risk Level: low Testing: yep Release Notes: inline Fixes #2303 Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
followup to #2362 Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: Rafal Augustyniak <raugustyniak@lyft.com>
In the commit #2362 we added a custom_headers_ field on the BaseClientIntegrationTest class to use for custom headers. This commit replaces that class field by instead instantiating a custom_headers object inside tests when necessary. Then adds a helper function to convert it from the TestRequestHeaderMapImpl (an easy to edit type) to RequestHeaders (envoy header type). Signed-off-by: caschoener schoener@google.com
Risk Level: low
Testing: yep
Release Notes: inline
Fixes #2303