Add some more tests for git_futils_rmdir_r and some cleanup - #4828
Merged
Conversation
Member
|
I've fixed your tests and also added a cleanup function that always removes left-over bits of the test directory hierarchy. With these changes, all tests pass just fine, and it seems to me like the empty directory hierarchy is being deleted just fine. Also, the following simple tests passes ( |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Currently, we do not clean up after ourselves after tests in core::rmdir have created new files in the directory hierarchy. This may leave stale files and/or directories after having run tests, confusing subsequent tests that expect a pristine test environment. Most importantly, it may cause the test initialization to fail which expects being able to re-create the testing hierarchy before each test in case where another test hasn't cleaned up after itself. Fix the issue by adding a cleanup function that removes the temporary testing hierarchy after each test if it still exists.
Contributor
Author
|
I cannot reproduce the issue any more which was the initial reason for this MR, however, this is a good extension for the test cases now... |
ethomson
reviewed
Oct 5, 2018
Member
|
Agreed, @csware, we should just merge this even though it doesn't catch any errors right now. |
Member
|
Agreed here, too. Thanks for the PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update: I cannot reproduce the issue any more which was the initial reason for this MR, however, this is a good extension for the test cases now...
old: When working on another issue I found that git_futils_rmdir_r does not delete an empty path hierarchy, just the last folder