Skip to content

test: integration test and admin integration test parameterization#1036

Merged
htuch merged 5 commits into
envoyproxy:masterfrom
hennna:plumb-integration-admin
Jun 5, 2017
Merged

test: integration test and admin integration test parameterization#1036
htuch merged 5 commits into
envoyproxy:masterfrom
hennna:plumb-integration-admin

Conversation

@hennna
Copy link
Copy Markdown
Contributor

@hennna hennna commented Jun 1, 2017

This PR parameterizes two integration tests: integration_test.cc and integration_admin_test.cc. The majority of the line changes are plumbing through the parameter version to allow code that originally hard coded an IPv4 address to now be parameterized.

This is the second step in parameterizing IPv4 and IPv6 testing in the integration tests. The first step was parameterizing the echo_integration_test in #953 . In this PR, we update many of the functions in integration.cc that are called in integration_test.cc to take the parameter version. Because other integration tests currently also rely on these functions, we set the default value to be Network::Address::IpVersion::v4. In a subsequent PR, we will also parameterize the other integration tests and the default value will be removed.

The constructor for RawConnectionDriver and function makeSingleRequest in test/integration/utility.h were also updated to set the default version value to v4. This required reordering the function parameters.

createTestServer and temporaryFileSubstitute were also updated in a similar fashion.

asan and tsan tests passing requires https://github.com/lyft/envoy-filter-example/pull/4/files due to dependence on changes made in this PR.

Supports ongoing work in #351

@htuch
Copy link
Copy Markdown
Member

htuch commented Jun 1, 2017

I just merged envoyproxy/envoy-filter-example#4, can you update this PR with the new envoy-ci hash? Thanks.

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Looks good, mostly questions about ways to reduce the churn..

Comment thread test/integration/integration.cc Outdated
fake_upstream_connection = fake_upstreams_[0]->waitForHttpConnection(*dispatcher_);
},
[&]() -> void { request = fake_upstream_connection->waitForNewStream(); },
[&]() -> void { request->waitForEndStream(*dispatcher_); },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How come so much churn in formatting? It's a bit harder to pick out the diff here.

Comment thread test/integration/integration.cc Outdated
codec_client = makeHttpConnection(lookupPort("http"), Http::CodecClient::Type::HTTP1, version);
},
[&]() -> void {
codec_client->startRequest(Http::TestHeaderMapImpl{{":method", "GET"},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Formatting here looks weird, the first block is done one way, the next another...

const std::string& host = "host");
makeSingleRequest(uint32_t port, const std::string& method, const std::string& url,
const std::string& body, Http::CodecClient::Type type,
Network::Address::IpVersion version = Network::Address::IpVersion::v4,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How come this is a parameter of the method? Can't makeSingleRequest call GetIpVersion() (nee GetParam()) to figure it out? Might simplify the call site churn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. This function is in test/integration/utility.cc

TEST_P(IntegrationAdminTest, Admin) {
BufferingStreamDecoderPtr response = IntegrationUtil::makeSingleRequest(
lookupPort("admin"), "GET", "/", "", Http::CodecClient::Type::HTTP1);
lookupPort("admin"), "GET", "/", "", Http::CodecClient::Type::HTTP1, GetParam());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add a wrapper method for GetParam() that provides semantic information about what the parameter is? E.g. GetIpVersion()?

@htuch
Copy link
Copy Markdown
Member

htuch commented Jun 1, 2017 via email

htuch pushed a commit to envoyproxy/envoy-filter-example that referenced this pull request Jun 2, 2017
Updates echo2 integration test to match onging changes in envoyproxy/envoy#1036 .
htuch
htuch previously approved these changes Jun 2, 2017
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Can you update the CI hash for the example and get the tests passing? Thanks.

@htuch
Copy link
Copy Markdown
Member

htuch commented Jun 4, 2017

@junr03 @RomanDzhabarov @ccaraman Can one of you take a look at this review?

@ccaraman ccaraman self-requested a review June 5, 2017 18:23
@htuch htuch merged commit fde77dc into envoyproxy:master Jun 5, 2017
@hennna hennna deleted the plumb-integration-admin branch June 7, 2017 15:48
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: Fixes incorrect signatures for the JNI calls on the trailers callback path in Android.
Risk Level: Low
Testing: Needs to be covered by AssertionFilter integration tests

Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: Fixes incorrect signatures for the JNI calls on the trailers callback path in Android.
Risk Level: Low
Testing: Needs to be covered by AssertionFilter integration tests

Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

3 participants