Skip to content

test: moving websocket tests to using HTTP codec.#4143

Merged
alyssawilk merged 5 commits intoenvoyproxy:masterfrom
alyssawilk:http_downstream_final
Aug 14, 2018
Merged

test: moving websocket tests to using HTTP codec.#4143
alyssawilk merged 5 commits intoenvoyproxy:masterfrom
alyssawilk:http_downstream_final

Conversation

@alyssawilk
Copy link
Contributor

Description: Moving the websocket test over to using HTTP rather than TCP helpers. This makes it much easier to do the full protocol mesh when we have H2 websockets.
Risk Level: Low (test only)
Testing: test passes.
Docs Changes: n/a
Release Notes: n/a

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>
Copy link
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my memory refreshed I see that "old style" refers to the styles of websocket support in Envoy described at https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/websocket. Maybe just refer to that at the top of the method so the context is obvious?

return AssertionFailure() << body().toString() << " not equal to " << data;
}
}
return success;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tiny nit: Call this "succeeded" instead of success to make it abundantly clear "return success" doesn't actually mean what it sounds like.

}

if (!old_style) {
// Check for and remove headers added by default for HTTP requests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you hoist these comments so they're above the method and/or add a bit more about what the "style" is in old and new? old_style doesn't give that much context on its own.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved this to take the member variable and done a one-time comment there. Let me know if you'd still like comments in both the validate functions.

bool old_style) {
Http::TestHeaderMapImpl proxied_response_headers(original_proxied_response_headers);
if (!old_style) {
// Check for and remove headers added by default for HTTP responses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, a comment above that concisely explains what the old_style behavior change is would be helpful.

if (original_response_headers.ContentLength() == nullptr) {
ASSERT_STREQ(proxied_response_headers.TransferEncoding()->value().c_str(), "chunked");
proxied_response_headers.removeTransferEncoding();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the same check on ContentLength is repeated for request and response. Worth factoring it out?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's perfect, thanks.

@alyssawilk alyssawilk merged commit f345c8b into envoyproxy:master Aug 14, 2018
snowp pushed a commit to snowp/envoy that referenced this pull request Aug 14, 2018
* origin/master:
  fix flaky RBAC integration test. (envoyproxy#4147)
  header_map: copy constructor for HeaderMapImpl. (envoyproxy#4129)
  test: moving websocket tests to using HTTP codec. (envoyproxy#4143)
  upstream: init host hc value based on hc value from other priorities (envoyproxy#3959)

Signed-off-by: Snow Pettersen <snowp@squareup.com>
@alyssawilk alyssawilk deleted the http_downstream_final branch November 28, 2018 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants