-
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
Coalesce directory management to Envoy::TestEnvironment #9721
Coalesce directory management to Envoy::TestEnvironment #9721
Conversation
- Drop std::[*]filesystem logic - Implement/tests for new Envoy::Filesystem::splitFileName - Remove unneeded TestEnvironment::createParentPath - Move/rename Envoy::TestUtility::createDirectory to Envoy::TestEnvironment::createPath - Move/rename Envoy::TestUtility::removeDirectory to Envoy::TestEnvironment::removePath - Move Envoy::TestUtility::renameFile to Envoy::TestEnvironment - Move Envoy::TestUtility::createSymlink to Envoy::TestEnvironment - Move AtomicFileUpdater from test_common utility to environment - Simplify Envoy::Filesystem::Watcher implementations using Filesystem - Clean up watcher_impl flavors for splitFileName API - Implement/new tests for Envoy::Filesystem::illegalPath for win32 - Implement watcher_impl for win32 [Initial development by Sam Smith] - Ensure top level test tempdir exists when requested Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Co-authored-by: Sam Smith <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
Avert making envoy tweaks within 'clang-format off' blocks Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[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.
Overall LGTM, thanks for slogging through this. Some questions/comments. Note that I just did a very fast skim of the win32 watcher code so I would make sure to have other folks review that part.
/wait
- Streamline the clang-format sensitivity for Envoy check/fix - Rename splitFileName to splitPathFromFilename for clarity and change to absl::string_views for args and std::pair results - Expose Api to watcher_impl for Filesystem - All addWatch() implementations now take absl::string_view name args - Clean up member variable naming for win32 watcher_impl - Prefer RELEASE_ASSERT to throw for anticipated normal behavior Signed-off-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Don't blow up in the DirectoryIterator for a broken link. Treat broken symlinks as 'Regular' files to be unlinked. Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: William A Rowe Jr <[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.
LGTM modulo some nits. Thank you!
/wait
if (::lstat(full_path.c_str(), &stat_buf) == 0 && S_ISLNK(stat_buf.st_mode)) | ||
return FileType::Regular; |
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.
braces around all if statements please, here and below. This should be caught by clang-tidy but clang-tidy is currently broken. @lizan @derekargueta any ETA on fixing that?
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.
Ack, reviewed and fixed throughout. Leaving unresolved for the open question of clang-tidy.
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.
check_format.py looks great generally; nice improvement. Just a minor suggestion.
Note: kqueue remains untested locally Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
- describe changes to directory_iterator_impl - use braces on all if/for statements - document source of windows invalid character table - add more description to AtomicFileUpdater class - capitalize test names in filesystem_impl_test Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
- clang-format off blocks must be closed with clang-format on - clang-format may not be nested Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[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.
Awesome, LGTM other than small remaining comments and master merge.
/wait
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[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.
Thanks LGTM with small remaining nit/cleanup.
/wait
Resolves test failing due to no file to substitute within Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
Hi @jmarantz - thanks for your observations and suggestions. One concern, if we wanted to show >1 error, we would want to constrain this to some sane number of errors (1..100?) I think we are mostly satisfied with the single error, although it can take more iterations to correct all the defects (provided one isn't using check_format.py fix). Otherwise, @sunjayBhatia and I reviewed your proposal and suspect it would be easier, if you like, to have you directly modify the branch with your proposal as you envision it (or, we can merge master and start a new effort.) Please feel free to @ include us on any re-tooling, since we are frequent users of these facilities :) |
I wouldn't expect a large # of errors but if there were more than one and you only showed one, I'd want the first one and not the last :) |
We've updated the code since the first draft to report on the first issue encountered. |
Initially we didn't believe the test framework required this, but those tests named with the convention FooTest/PROTO will require FooTest to first be created before PROTO. Signed-off-by: William A Rowe Jr <[email protected]>
I believe the requested changes are now addressed, please clarify if we've missed anything. |
Resolves TapIntegrationTest failure Signed-off-by: William A Rowe Jr <[email protected]>
for line_number, line in enumerate(readLines(path)): | ||
if line.find("// clang-format off") != -1: | ||
if not format_flag and error_message is None: | ||
error_message = "%s:%d: %s" % (path, line_number + 1, "clang-format nested off") |
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.
as suggested earlier, can you pass reportError as a lambda into evaluateLines so you don't have to repeat the error-message formatting logic here & below? You can still show only one clang-format nesting error if you want by keeping a local bool.
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.
/azp run envoy-linux |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Thanks!
Description:
Risk Level: low
Testing: local on linux gcc, windows msvc
Docs Changes: n/a
Release Notes: n/a