-
Notifications
You must be signed in to change notification settings - Fork 34
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
How to handle permissions? #140
Comments
I think some more context is needed to be able to help with what you are doing. Where you are writing to and how you are doing it are important factors. In case you weren't aware, I tend to use https://github.com/assert-rs/assert_fs or https://github.com/assert-rs/trycmd for creating a scratchpad to write to. |
@epage Not using either of those for this specific test, which is this: https://github.com/milesj/monolith/pull/5/files#diff-9a1f0aa2064ff70580494869ae0fa8a4f7c3e9b26cf3eabdfee35a0d6b17baf7R6-R9 I want to test that this code, which the CLI runs, actually works in a real world use case: https://github.com/milesj/monolith/blob/master/crates/toolchain/src/tools/node.rs#L189-L215 Right now I either get a "Permission denied" or "No such file or directory" error. |
Under what conditions do you get each of those errors? Is this local, CI, or both? What platforms are you seeing the failure? Know of platforms that work? btw this is most likely a very specific setup failure or a program bug. I'd recommend tracing in to see which call is failing and verifying the inputs to that call and make sure you are reproducing with those same inputs. |
@epage It fails locally and in CI, for both mac/linux. I'll try and trace to debug more. |
@milesj I think I found the problem, but it does bring up a question. Does Is there a way to write these in an async/await fashion? |
Yes, this is for one-shot testing rather than interactive testing, so it waits for the program to finish. |
This is still happening, but I've narrowed it down to this line: https://github.com/milesj/moon/blob/master/crates/toolchain/src/helpers.rs#L78 It seems like the dirs aren't being created on line 71 and I have no idea why. This is the entire test https://github.com/milesj/moon/pull/5/files#diff-a31902d06ac6afdddf64feb76dc589f59e39a33434c352de60ba84f8beca4427R16 |
Not sure what changed, but this isn't an issue anymore. Closing. |
First off, great library.
I'm trying to test my CLI commands that modify the file system, but the tests get a permission denied error, while I'm able to run it locally just fine. Is there anyway to support this?
The text was updated successfully, but these errors were encountered: