rust-random / rust-random/getrandom

Code test coverage should be measured and reported in CI

Open
#288 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted testing
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.