Skip to content

Commit

Permalink
reduce test permutations by around 50% by not testing http3 in the lu…
Browse files Browse the repository at this point in the history
…a integration test

Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
  • Loading branch information
yuval-k committed Feb 20, 2025
1 parent caa12a7 commit 1a714a9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/extensions/filters/http/lua/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ envoy_extension_cc_test(

envoy_extension_cc_test(
name = "lua_integration_test",
size = "enormous",
size = "large",
srcs = ["lua_integration_test.cc"],
extension_names = ["envoy.filters.http.lua"],
rbe_pool = "6gig",
Expand Down
31 changes: 27 additions & 4 deletions test/extensions/filters/http/lua/lua_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ class LuaIntegrationTest : public UpstreamDownstreamIntegrationTest {
addFakeUpstream(Http::CodecType::HTTP2);
}

static std::vector<std::tuple<HttpProtocolTestParams, bool>>
getDefaultTestParams(const std::vector<Http::CodecType>& downstream_protocols =
{
Http::CodecType::HTTP1,
Http::CodecType::HTTP2,
},
const std::vector<Http::CodecType>& upstream_protocols = {
Http::CodecType::HTTP1,
Http::CodecType::HTTP2,
}) {
std::vector<std::tuple<HttpProtocolTestParams, bool>> ret;
std::vector<HttpProtocolTestParams> protocol_defaults =
HttpProtocolIntegrationTest::getProtocolTestParams(downstream_protocols,
upstream_protocols);
const std::vector<bool> testing_downstream_filter_values{true, false};

for (auto& param : protocol_defaults) {
for (bool testing_downstream_filter : testing_downstream_filter_values) {
ret.push_back(std::make_tuple(param, testing_downstream_filter));
}
}
return ret;
}

void initializeFilter(const std::string& filter_config, const std::string& domain = "*") {
config_helper_.prependFilter(filter_config, testing_downstream_filter_);

Expand Down Expand Up @@ -262,10 +286,9 @@ class LuaIntegrationTest : public UpstreamDownstreamIntegrationTest {
FakeStreamPtr lua_request_;
};

INSTANTIATE_TEST_SUITE_P(
Protocols, LuaIntegrationTest,
testing::ValuesIn(UpstreamDownstreamIntegrationTest::getDefaultTestParams()),
UpstreamDownstreamIntegrationTest::testParamsToString);
INSTANTIATE_TEST_SUITE_P(Protocols, LuaIntegrationTest,
testing::ValuesIn(LuaIntegrationTest::getDefaultTestParams()),
UpstreamDownstreamIntegrationTest::testParamsToString);

// Regression test for pulling route info during early local replies using the Lua filter
// metadata() API. Covers both the upgrade required and no authority cases.
Expand Down

0 comments on commit 1a714a9

Please sign in to comment.