Skip to content

Conversation

oschaaf
Copy link
Member

@oschaaf oschaaf commented Sep 17, 2020

Switch tests for these extensions to use the recent shared test
facilities. Eliminate tests we generalize in #533.

Split out from #512

Signed-off-by: Otto van der Schaaf oschaaf@we-amp.com


Switch tests for these extensions to use the recent shared test
facilities. Eliminate tests we generalized in envoyproxy#533.

Split out from envoyproxy#512

Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
@mum4k
Copy link
Collaborator

mum4k commented Sep 17, 2020

@dubious90 please review and assign back to me once done.

Copy link
Contributor

@dubious90 dubious90 left a comment

Choose a reason for hiding this comment

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

migration looks good. Also have one chage-level question:
I'm surprised there are no corresponding bazel changes - do we need to bring in a dependency on the new fixture and remove the old one?

};

INSTANTIATE_TEST_SUITE_P(IpVersions, HttpDynamicDelayIntegrationTest,
testing::ValuesIn(Envoy::TestEnvironment::getIpVersionsForTest()));

// Verify expectations with an empty dynamic-delay configuration.
TEST_P(HttpDynamicDelayIntegrationTest, NoStaticConfiguration) {
setup(R"(
initializeFilterConfiguration(R"(
name: dynamic-delay
typed_config:
"@type": type.googleapis.com/nighthawk.server.ResponseOptions
)");
// Don't send any config request header
Copy link
Contributor

Choose a reason for hiding this comment

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

Contxt for a few comments here: If I understand correctly, we're saving some effort by having these all be one test to prevent having to initialize a filter repeatedly (which I assume is slow?). That makes sense here.

However, I think it would be good if we clarified individual test cases within the TEST_P block a little.

  1. "Don't send any config request header" is describing what we are doing - can we add in what behavior we're expecting this to produce?

  2. Can we space out all of the individual test cases separately:

e.g.

getResponse();
EXPECT_EQ()

// Comment for test 2
...```

setRequestLevelConfiguration("{}");
getResponse(ResponseOrigin::UPSTREAM);
EXPECT_EQ(upstream_request_->headers().get(kDelayHeaderString), nullptr);
// Send a config request header, this should become effective.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than saying this should become effective, can we describe what the behavior should be?

// Send a config request header with an empty / default config. Should be a no-op.
getResponse("{}");
setRequestLevelConfiguration("{}");
getResponse(ResponseOrigin::UPSTREAM);
// Send a config request header, this should become effective.
Copy link
Contributor

Choose a reason for hiding this comment

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

same comments here about describing behaviors

@dubious90 dubious90 added waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. and removed waiting-for-review A PR waiting for a review. labels Sep 17, 2020
Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
@oschaaf
Copy link
Member Author

oschaaf commented Sep 17, 2020

@dubious90 feedback applied in 2fa83ee
The build file changes have already been merged in https://github.com/envoyproxy/nighthawk/pull/517/files, which is why they no longer show up here.

@oschaaf oschaaf added waiting-for-review A PR waiting for a review. and removed waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. labels Sep 17, 2020
…r-prelude-5

Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
@oschaaf
Copy link
Member Author

oschaaf commented Sep 18, 2020

With #540 merged, the merge of this one needs to hold off until #533 lands, to avoid a coverage dip because of the redundant test eliminations that we perform here. Adding that as a task in the PR description.

Copy link
Collaborator

@mum4k mum4k 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.

Can you kick Circle CI to ensure all checks pass?

@mum4k mum4k added waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. and removed waiting-for-review A PR waiting for a review. labels Sep 21, 2020
…r-prelude-5

Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
@oschaaf oschaaf added waiting-for-review A PR waiting for a review. and removed waiting-for-changes A PR waiting for comments to be resolved and changes to be applied. labels Sep 23, 2020
@oschaaf
Copy link
Member Author

oschaaf commented Sep 23, 2020

Looks good.

Can you kick Circle CI to ensure all checks pass?

Done, merged master in here, and tests are passing now.

@mum4k mum4k merged commit b189069 into envoyproxy:master Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-review A PR waiting for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants