test: add a common test base class#5811
Conversation
…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>
|
Note: after this PR there are still 879 instances of |
The diff is so big that I can't easily find this. Can you link it or potentially just do a PR where we review the base class and a single test? I don't have a strong opinion about this if people think having this is worth it (as long as we have it checked by the formatter). Also it looks like clang-tidy is broken. /wait |
|
feel free to ignore the broken clang-tidy build, it is because the diff is too big (across too many files) |
|
The new class is: This gets implicitly linked implicitly with envoy_cc_test_library via a new dependency in envoy_build_system.bzl: An example test change is in The bulk of the changes are pretty simple like that. The other changes are almost 100% from a script that does a file-tree string-replacement. From my shell history there were several of these: After this there were a few tweaks required to deal with patterns like @lizan you are right I think clang-tidy is really hard on this PR. I have been iterating on it locally and it takes hours. There were a lot of legacy clang-tidy violations which this PR awakened. I've fixed a bunch of them and committed them locally, but did not push the change yet. It'd be better to merge this first if you think this is worth it, as it's a real merge-conflict magnet :) I'm not too invested in this; IMO it's a good hook to have. |
|
For the record I went through all the clang-tidy warnings and fixed most of them. I could find no errors, so I guess in CI it just failed due to excessive size. Some of the clang-tidy suggestions are wrong: IMO:
Others are annoying:
I will send a follow-up PR with the clang-tidy changes that made sense after this is merged. |
|
@jmarantz thanks for the links. If you want to go with this and are willing to do the work to replace |
|
Yup will merge but need approval I think per tool. Will follow up with ^TEST( replacement. Should be pretty straightforward. |
Signed-off-by: Joshua Marantz <jmarantz@google.com> Signed-off-by: Fred Douglas <fredlas@google.com>
…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>
Description: There's been a few cases where I wish I could get a global teardown/setup hook but Envoy lacked a common test base-class. This giant PR adds one. Sorry it's incredibly huge...I don't know if it's worth breaking up. This was mostly done with sed scripts with minor manual fixups where needed, and no functional logic was changed.
Currently in the common per-test teardown we just check that all the test-scoped singletons are freed. But there may be other uses for this hook.
Risk Level: low
Testing: //test/..., in fastbuild and tsan
Docs Changes: n/a
Release Notes: n/a