Skip to content
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

Merged
merged 8 commits into from
Sep 17, 2019

Conversation

LisaLudique
Copy link
Contributor

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:]

@LisaLudique
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🤷‍♀️ nothing to rebuild.

🐱

Caused by: a #8240 (comment) was created by @LisaLudique.

see: more, trace.

Signed-off-by: Lisa Lu <[email protected]>
@LisaLudique
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: release (failed build)

🐱

Caused by: a #8240 (comment) was created by @LisaLudique.

see: more, trace.

jyotimahapatra
jyotimahapatra previously approved these changes Sep 16, 2019
@mattklein123 mattklein123 self-assigned this Sep 17, 2019
Copy link
Member

@mattklein123 mattklein123 left a 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

@@ -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,
Copy link
Member

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.

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;
Copy link
Member

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

// check.
void RouterCheckTool::assignUniqueRouteNames(envoy::api::v2::RouteConfiguration& route_config) {
Runtime::RandomGeneratorImpl random;
std::string route_name;
Copy link
Member

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

@@ -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
Copy link
Member

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]>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thank you!

@mattklein123 mattklein123 merged commit 616347f into envoyproxy:master Sep 17, 2019
@jyotimahapatra
Copy link
Contributor

#730

danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Sep 24, 2019
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Oct 4, 2019
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Oct 4, 2019
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