How to test I/O errors
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading pull request #574 and the rustup-utils I/O functions involved in that fix. Compare the proposed FUSE filesystem and mocking approaches, including network coverage, then define a test strategy and completion criteria with maintainers; this issue does not yet specify an implementation or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100