You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just posted a fix for a file system error that I can't test for. rustup error handling is important but hard to test. In this case I would want to trigger out-of-disk during an installation. I'd prefer to be able to test this stuff.
I see two options:
Write a fuse filesystem to create the errors. Requires a lot of work, only works for file system access, not network.
Add mocking to the rustup-utils I/O functions, so that the test runner can e.g. set environment variables telling the I/O layer to generate specific errors. Downside is that it's ugly and isn't exercising big parts of the I/O stack.
I'm inclined toward the latter. @alexcrichton do you have opinions?
The text was updated successfully, but these errors were encountered:
As a pipe dream: wouldn't it be awesome if I could inject behavior into std's I/O stack? With std-aware cargo I can foresee replacing the I/O crate with an I/O crate that can introduce mock behavior.
We may only need great coverage here on at least one platform, so I wonder if we could use linux containers in one way or another here? I think that would allow us to basically intercept all system calls and set custom quotas for things. The tests might be brittle over time but perhaps that's not so bad?
I agree that of those two options the latter is better, but I wouldn't be too thrilled about a mocking framework there :(
I just posted a fix for a file system error that I can't test for. rustup error handling is important but hard to test. In this case I would want to trigger out-of-disk during an installation. I'd prefer to be able to test this stuff.
I see two options:
I'm inclined toward the latter. @alexcrichton do you have opinions?
The text was updated successfully, but these errors were encountered: