tests: use rm -rf instead of rmdir in teardown #2010
Merged
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.
Most
teardown
scripts userm -rf
to delete directories the tests created.test/fast/Listing versions/teardown
andtest/fast/Listing paths/teardown
usedrmdir
instead, which fails in most cases because the directories are not empty.This PR replaces
rmdir
byrm -rf
in these scripts. It also drops the>/dev/null 2>&1
part, becauserm -f
never prints any errors anyway.Additionally, I removed the line
unalias nvm_has_system_node
fromtest/fast/Listing versions/teardown
because the tests don't create an alias (instead, they redefine the functionnvm_has_system_node
), and it looks like the new definition ofnvm_has_system_node
does not exist anymore after the tests have run (probably because the each test runs in its own process). But I only tested this on my machine by running the tests as scripts. For example:In case I missed something and the behavior is different in other shells or in urchin, I'd be happy to add the
unalias
line again.