Cleanup unit test temp folders - #455
Merged
Merged
Conversation
The constructor being tested does not branch differently based on relative path prefixes. There doesn't seem to be a clear purpose in testing this code with various prefixes. Maybe the lower level path handling code could use tests with various prefixes, though if needed that should get it's own tests rather than be a part of this one.
Actually, as a matter of style, I don't know how common it is to put unit test assertions in helper methods, as opposed to keeping all test assertions in the test case itself. Something about it seemed mildly unexpected, though I can see why it would be convenient.
These are effectively two separate behaviors, that should probably get two separate tests.
We don't want coupling between independent tests. We could check that a folder is not created in the failure test case, though if the create test case leaves one around, that could cause the failure test case to fail due to different tests on the same object.
The lack of cleanup was hidden by the cleanup in the recently updated test case. Whether a folder was left behind or not was potentially order dependent. This is because both test cases operated on the same folder, so effectively shared an object.
Potentially this could also be useful if tests are run in parallel, as using separate folders would prevent them from interfering with each other.
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.
Cleanup temp folders as well as any generated temp files.
Rename temp folders so they are not shared by different test cases. This prevents unintended sharing of resources (the folder), and potential order dependent behaviors.
Related:
NewDirectory#453Closes #453