stacks-network / stacks-network/stacks-core
Mutation Tests testnet/stacks-node/src/neon_node.rs > run_tenure
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.1k
- Forks
- 762
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 76
Description
Related #4587
The mutation testing highlighted there might be missing unit tests for run_tenure but there needs to be created a default for MinerThreadResult to check it.
The steps for making sure the run_tenure function has its possible outcomes caught are:
- create default for
MinerThreadResult - remove the skip header
#[cfg_attr(test, mutants::skip)] - check if mutation tests are caught for these cases:
- run
RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace BlockMinerThread::run_tenure" -E ": replace .{1,2} with .{1,2} in " --baseline=skip --test-tool=nextest -- --run-ignored all --no-fail-fast --test-threads 1- Some(Default::default())
- create tests if they aren't caught
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 in testnet/stacks-node/src/neon_node.rs at BlockMinerThread::run_tenure, then inspect MinerThreadResult and the #[cfg_attr(test, mutants::skip)] header. Run the provided cargo mutants command with the stated environment and options. Done means a default exists for MinerThreadResult, the skip is removed, and the relevant mutations are caught, with tests added for any uncaught cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100