-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add support for outputting missing tests #8240
Add support for outputting missing tests #8240
Conversation
Signed-off-by: Lisa Lu <[email protected]>
Signed-off-by: Lisa Lu <[email protected]>
Signed-off-by: Lisa Lu <[email protected]>
Signed-off-by: Lisa Lu <[email protected]>
/retest |
🤷♀️ nothing to rebuild. |
Signed-off-by: Lisa Lu <[email protected]>
Signed-off-by: Lisa Lu <[email protected]>
/retest |
🔨 rebuilding |
Signed-off-by: Lisa Lu <[email protected]>
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.
Cool stuff. LGTM with some small nits. Thank you!
/wait
test/tools/router_check/coverage.cc
Outdated
@@ -53,7 +53,27 @@ double Coverage::report() { | |||
return 100 * static_cast<double>(covered_routes_.size()) / num_routes; | |||
} | |||
|
|||
void Coverage::printMissingTests(std::set<std::string> const& all_route_names, |
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.
You want: const std::set<std::string>&
, same below.
test/tools/router_check/coverage.cc
Outdated
std::set_difference(all_route_names.begin(), all_route_names.end(), covered_route_names.begin(), | ||
covered_route_names.end(), | ||
std::inserter(missing_route_names, missing_route_names.end())); | ||
std::set<std::string>::iterator it; |
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: just define this on line 65
test/tools/router_check/router.cc
Outdated
// check. | ||
void RouterCheckTool::assignUniqueRouteNames(envoy::api::v2::RouteConfiguration& route_config) { | ||
Runtime::RandomGeneratorImpl random; | ||
std::string route_name; |
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: remove variable, just inline uuid() call on line 97
test/tools/router_check/router.cc
Outdated
@@ -84,6 +86,19 @@ RouterCheckTool RouterCheckTool::create(const std::string& router_config_file, | |||
std::move(api), Coverage(route_config)); | |||
} | |||
|
|||
// Set UUID as the name for each route for detecting missing tests during the coverage |
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: move this comment to the header file
Signed-off-by: Lisa Lu <[email protected]>
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.
Thank you!
…y#8240) Signed-off-by: Lisa Lu <[email protected]>
…y#8240) Signed-off-by: Lisa Lu <[email protected]>
…y#8240) Signed-off-by: Lisa Lu <[email protected]>
Signed-off-by: Lisa Lu [email protected]
Description: Previously the router check tool only supported outputting the percentage of routes covered from the coverage reports. This made it difficult to determine which routes were actually missing tests. This change adds support for printing out routes that aren't covered by any tests as a part of the detailed coverage report (under the flag --covall). Relates to #730.
Risk Level: Low
Testing: Added a unit test against to check output in route_tests.sh.
Docs Changes: included
Release Notes: included
[Optional Fixes #Issue]
[Optional Deprecated:]