Selectively specifying elevated privilege requirement for test
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the linked Cargo issue #5999 and the existing cargo test behavior; the report names no files or tests to inspect. Clarify how a test declares an elevated-privilege requirement and how cargo test should handle marked tests when privilege is absent, using the proposed behavior as the completion criteria.
Written by the indexing model from the issue text.
Description
Problem
I am developing an embedded SW with rust which definitely requires root privilege to access HW.
The issue https://github.com/rust-lang/cargo/issues/5999#issue-358372249 has been closed but with "globally" running cargo with "sudo" as a solution.
Of course, one can write a shell script to run certain tests with "sudo" by passing the test names as arguments. However, it is not ergonomic and possibly requires writing a separate shell script for non-privilege requiring tests.
Proposed Solution
- It would be much safe and ergonomic if one could mark a certain test need to be executed under elevated privilege.
- In case the "cargo test" has run without the privilege, those marked tests would not get executed.
Notes
No response
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
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.
More from rust-lang/cargo
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
A-completions C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Command-fix
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
cargo remove prints "Removing X" for dependencies that never get removed when the command fails OpenC-bug Command-remove S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100