Commit 397994c9 authored by Daniel McArdle's avatar Daniel McArdle Committed by Commit Bot

Cut down combinatorial explosion in parameterized HTTPSSVC tests.

In https://crrev.com/c/2089958, httpssvc_metrics_unittest.cc added 1.5%
more tests to net_unittests (39202 to 39790).

We can compute the number of tests that httpssvc_metrics_unittest.cc
produces by looking at both occurrences of INSTANTIATE_TEST_SUITE_P and
the number of parameterized tests. This accounts for (3*2*2)*(3*2*2)*2*2
+ 2*6 = 588 tests = 39790 - 39202.

This CL eliminates some redundancy in the instantiation of
HttpssvcMetricsTestDomainParsing, bringing us to (3*2*2)*(2*1*1)*2*2 +
2*6 = 108 tests, which only contributes 0.28% more tests from a baseline
of 39202.

Bug: 1096073
Change-Id: I8d37f5ebcf883f7c116d46db9d6aa52c8bb75e7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2248751Reviewed-by: default avatarEric Orth <ericorth@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780524}
parent 7a8b5f23
......@@ -91,7 +91,6 @@ struct HttpssvcFeatureConfig {
bool use_integrity = false;
bool use_httpssvc = false;
bool control_domain_wildcard = false;
bool query_over_insecure = false;
std::string experiment_domains;
std::string control_domains;
};
......@@ -149,19 +148,24 @@ INSTANTIATE_TEST_SUITE_P(
HttpssvcMetricsTestDomainParsing,
HttpssvcDomainParsingTest,
testing::Combine(
// DomainListQuirksTuple for experimental domains.
testing::Combine(testing::Range(0, 3),
testing::Bool(),
testing::Bool()),
// DomainListQuirksTuple for experimental domains. To fight back
// combinatorial explosion of tests, this tuple is pared down more than
// the one for control domains. This should not significantly hurt test
// coverage because |IsExperimentDomain| and |IsControlDomain| rely on a
// shared helper function.
testing::Combine(testing::Values(0, 1),
testing::Values(false),
testing::Values(false)),
// DomainListQuirksTuple for control domains.
testing::Combine(testing::Range(0, 3),
testing::Bool(),
testing::Bool()),
// HttpssvcFeatureTuple
testing::Combine(testing::Bool() /* DnsHttpssvc feature enabled? */,
testing::Bool() /* use_integrity */,
testing::Values(false) /* use_httpssvc */,
testing::Values(false) /* query_over_insecure */)));
testing::Combine(
testing::Bool() /* DnsHttpssvc feature enabled? */,
testing::Bool() /* DnsHttpssvcUseIntegrity */,
testing::Values(false) /* DnsHttpssvcUseHttpssvc */,
testing::Values(false) /* DnsHttpssvcControlDomainWildcard */)));
// Base for testing the metrics collection code in |HttpssvcMetrics|.
class HttpssvcMetricsTest
......@@ -283,9 +287,9 @@ INSTANTIATE_TEST_SUITE_P(
// HttpssvcFeatureTuple
testing::Combine(
testing::Values(true) /* DnsHttpssvc feature enabled? */,
testing::Values(true) /* use_integrity */,
testing::Values(false) /* use_httpssvc */,
testing::Values(false) /* query_over_insecure */)));
testing::Values(true) /* DnsHttpssvcUseIntegrity */,
testing::Values(false) /* DnsHttpssvcUseHttpssvc */,
testing::Values(false) /* DnsHttpssvcControlDomainWildcard */)));
TEST_P(HttpssvcDomainParsingTest, ParseFeatureParamIntegrityDomains) {
// We are not testing this feature param yet.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment