rust-random / rust-random/getrandom
Code test coverage should be measured and reported in CI
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 580
- Forks
- 259
- PR merge metrics
- No merged PRs in 30d
Description
There is a lot of runtime feature detection and other conditional logic in this crate. AFAICT, when tests are run, it is arbitrary which implementation gets picked. For example, for Linux, AFAICT only the getrandom syscall implementation is tested, and the file I/O fallback is not tested. Publishing the code test coverage report would make it clear which code isn't being tested on which platforms.
There is a lot of code that is copy-modified-pasted. This is understandable because some targets have slightly different APIs. My hope is that when code test coverage measurement is published, we'll see clearly which duplicated coding patterns we should factor out to increase the code coverage further to minimize the amount of uncovered code for difficult-to-test (lacking test runners) platforms.
Also I expect having code test coverage will facilitate more exhaustive testing, such as writing tests that exercsise both the getrandom syscall branch and the File I/O, e.g. by using ptrace or equivalent, similar to what BoringSSL does.
Contributor guide
No contributing guide indexed for this repository
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 inspecting the crate's CI configuration and how tests select platform-specific implementations. Compare coverage for the getrandom syscall path and the file I/O fallback across supported platforms; done means CI publishes a report that makes untested implementations and conditional branches visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ci-cd, operating-systems, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100