Skip to content

Add support for outputting missing tests#8240

Merged
mattklein123 merged 8 commits intoenvoyproxy:masterfrom
LisaLudique:missing-test-output
Sep 17, 2019
Merged

Add support for outputting missing tests#8240
mattklein123 merged 8 commits intoenvoyproxy:masterfrom
LisaLudique:missing-test-output

Conversation

@LisaLudique
Copy link
Copy Markdown
Contributor

Signed-off-by: Lisa Lu lisalu@lyft.com

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

Signed-off-by: Lisa Lu <lisalu@lyft.com>
Lisa Lu added 3 commits September 13, 2019 15:47
Signed-off-by: Lisa Lu <lisalu@lyft.com>
Signed-off-by: Lisa Lu <lisalu@lyft.com>
@LisaLudique
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🤷‍♀️ nothing to rebuild.

🐱

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

see: more, trace.

Signed-off-by: Lisa Lu <lisalu@lyft.com>
Signed-off-by: Lisa Lu <lisalu@lyft.com>
@LisaLudique
Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🔨 rebuilding ci/circleci: release (failed build)

🐱

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

see: more, trace.

Signed-off-by: Lisa Lu <lisalu@lyft.com>
jyotimahapatra
jyotimahapatra previously approved these changes Sep 16, 2019
@mattklein123 mattklein123 self-assigned this Sep 17, 2019
Copy link
Copy Markdown
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

return 100 * static_cast<double>(covered_routes_.size()) / num_routes;
}

void Coverage::printMissingTests(std::set<std::string> const& all_route_names,
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

std::move(api), Coverage(route_config));
}

// Set UUID as the name for each route for detecting missing tests during the coverage
Copy link
Copy Markdown
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 <lisalu@lyft.com>
Copy link
Copy Markdown
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
Copy Markdown
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