-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Lambda json parsing #328
Conversation
c57bd15
to
087fd76
Compare
#include "test/mocks/server/mocks.h" | ||
#include "test/test_common/utility.h" | ||
|
||
#include "fmt/format.h" | ||
#include "nlohmann/json.hpp" | ||
#include "gmock/gmock.h" | ||
#include "gtest/gtest.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed (along with the changes to the BUILD file) to improve compilation times for these tests
on my machine, this reduced the time to compile small changes to the already-cached suite from 80s to 60s
Issues linked to changelog: |
|
||
if (expected_error_message.empty()) { | ||
transformer.transform(response_headers, &headers, *bodyPtr, filter_callbacks_); | ||
auto lowercase_multi_header_name = Http::LowerCaseString("test-multi-header"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would be nice to move "test-multi-header"
to an external const
value
ApiGatewayTransformer transformer; | ||
NiceMock<Http::MockStreamDecoderFilterCallbacks> filter_callbacks_{}; | ||
|
||
if (expected_error_message.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would prefer to use std::optional
instead of empty strings as sentinel values
void test_multi_value_headers_transformation( | ||
std::unique_ptr<Buffer::OwnedImpl> bodyPtr, | ||
std::string expected_error_message = "Error transforming response: [json.exception.type_error.302] type must be string, but is null", | ||
std::string expected_multi_value_header = "multi-value-0,multi-value-1,multi-value-2") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: would prefer to see these as external const
values
* messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry
* messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry
* messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry
* Fix: Lambda json parsing (#328) * messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry * move changelog --------- Co-authored-by: Ben Taussig <85883594+ben-taussig-solo@users.noreply.github.com>
* Fix: Lambda json parsing (#328) * messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry * move changelog --------- Co-authored-by: Ben Taussig <85883594+ben-taussig-solo@users.noreply.github.com>
* Fix: Lambda json parsing (#328) * messy early commit: reduce test deps, annotate api gateway transformer, tests to describe failure modes * safety adjustments to api_gateway_transformer.cc * clean up some comments in api_gateway_transformer.cc * messy update to transformer_teest.cc * remove duplicate log line * clean up unnecessary tests, todos * reintroduce transform_single_and_multi_value_headers test * remove other unintentionally removed tests * additional test cleanup * fix whitespace changes + address remaining comments in tests * add changelog entry * move changelog --------- Co-authored-by: Ben Taussig <85883594+ben-taussig-solo@users.noreply.github.com>
Description
Summary of bug
Summary of changes
Primary fix
std::string
related fix
status code type checking