Skip to content

test: fix several clang-tidy warnings from #5811#5826

Merged
jmarantz merged 8 commits intoenvoyproxy:masterfrom
jmarantz:envoy-test-base-class
Feb 4, 2019
Merged

test: fix several clang-tidy warnings from #5811#5826
jmarantz merged 8 commits intoenvoyproxy:masterfrom
jmarantz:envoy-test-base-class

Conversation

@jmarantz
Copy link
Copy Markdown
Contributor

@jmarantz jmarantz commented Feb 4, 2019

Description: #5811 failed its clang-tidy test just due to its size, but in examining the results I found a bunch of reasonable warnings to fix, which I did thinking it might make clang-tidy CI pass. However the root cause of the CI failure was just size, and not actual errors.
Risk Level: low
Testing: //test/..., clang-tidy
Docs Changes: n/a
Release Notes: n/a

…st and variants.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz reopened this Feb 4, 2019
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Are all of these set to yield failures on regular sized builds? How come clang-tidy doesn't scale?

)EOF";

SetUpTest(json);
setUpTest(json);
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.

There's a weird lexical/grammar thing going on here with setUp; I would write it as setupTest. I think you are paying homage to gtest's SetUp, which is also pretty weird IMHO; is it a pun on "up"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

:) I was just changing one character in an already-existing test-method to reflect the fact that this is a locally defined class method, not associated with gtest at all (and easy to confuse with it). So it should use Envoy's convention of a lower-cased first character.

But you're right, this looks weird, so I might as well clean this up and change it to setupTest. Any other issues?

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.

Nup, that's all good. I'd like to make more of these warnings act as errors though, I always prefer cleanups that don't need to ever be done again :) Thanks for doing the grungey work in this PR.

@htuch htuch self-assigned this Feb 4, 2019
@jmarantz
Copy link
Copy Markdown
Contributor Author

jmarantz commented Feb 4, 2019

RE why does clang-tidy not scale? Not sure. It's processing diffs very slowly, and on a large PR there are a metric ton of diffs. @lizan ?

@jmarantz
Copy link
Copy Markdown
Contributor Author

jmarantz commented Feb 4, 2019

And none of these were failing individually. They were just warnings.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz changed the title test: fix several clang-tidy warning from #5811 test: fix several clang-tidy warnings from #5811 Feb 4, 2019
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

@htuch
Copy link
Copy Markdown
Member

htuch commented Feb 4, 2019

Please merge master to pick up #5827.

@jmarantz jmarantz merged commit d95f568 into envoyproxy:master Feb 4, 2019
@jmarantz jmarantz deleted the envoy-test-base-class branch February 4, 2019 22:00
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…y#5826)

* test: fix several clang-tidy warnings from envoyproxy#5811

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
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.

2 participants