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
Fix missing file names from rm errors #9120
Fix missing file names from rm errors #9120
Conversation
i propose safer tests that do not require touching sudo mkdir -p /tmp/nushell/nushell#9120/foo
sudo touch /tmp/nushell/nushell#9120/foo/bar.txt then
😌 |
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.
that looks good to me 💪
i could reproduce the same kind of errors with the /tmp/
tests above 😌
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #9120 +/- ##
=======================================
Coverage 68.91% 68.91%
=======================================
Files 641 641
Lines 102337 102331 -6
=======================================
- Hits 70522 70518 -4
+ Misses 31815 31813 -2
|
Can't we test this using something like this? |
This comment was marked as outdated.
This comment was marked as outdated.
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.
Can't we test this using something like this?
oooh maybe!
@michaeljohnalbers
could you give this a try, that'd be great ✨
just to have your simple test in the source base 😌
@amtoine Added a unit test for this. |
@michaeljohnalbers you might have to run
to fix the CI 😌 also you can directly run
to make sure everything is ok at once 😏 |
@amtoine Sorry about that. I thought I had my git hooks set up, but it seems I didn't. I ran the formatter as well as |
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.
amazing, that looks better 👌
let's run the CI and see if it passes 😇
@michaeljohnalbers |
@amtoine We don't have to skip them, it just doesn't gain anything to run them on Windows. The code being tested is OS independent. However, triggering that specific error does start getting into OS specific territory. As I'm not a Windows dev and have nothing set up to develop and test the unit test on Windows it was easier to just exclude it from running on Windows. |
could we still try them in the CI, to see if it works on all OSes? i do not have windows available too, so i dunnot either 👀 |
One of the earlier CI runs did attempt to run the new test on Windows and it did fail. The assertion verifying the files were not deleted failed. This was despite making the containing folder/directory read-only. Test which failed: https://github.com/nushell/nushell/actions/runs/4931264176/jobs/8830252909?pr=9120 |
@michaeljohnalbers i'm not a windows chad so i'd rather leave the final word to a more familiar member of the core-team 😌 |
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 this is quite a minor change, i.e. it only changes the error being sent to the user, no other behaviour change, i think we can land this and see how it goes 😌
thanks @michaeljohnalbers for the fix ✨
Description
Fixes a small bug with
rm
where names of files which couldn't be deleted due to error were not printed.Fixes #9004
User-Facing Changes
Slightly different error message than previously. Nothing significant, though.
The new error message looks like this
or when using a glob (only showing a single entry for brevity)
Tests + Formatting
No new unit tests were added for this change as it is pretty difficult to test this particular case. However, manual testing was run with the following commands
After Submitting
N/A