stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Mutation Tests testnet/stacks-node/src/nakamoto_node/miner.rs > load_block_parent_info, mine_block, lookup

Open ASuciuX opened this issue 9 months ago • 0 comments

Related #4587

The mutation testing highlighted there might be missing unit tests for load_block_parent_info but there needs to be created a default for NakamotoNodeError, NakamotoBlock and ParentStacksBlockInfo to check it.

The steps for making sure the load_block_parent_info function has its possible outcomes caught are:

  • [ ] create default for BlockBuilderSettings
  • [ ] 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::load_block_parent_info" -E ": replace .{1,2} with .{1,2} in " --baseline=skip --test-tool=nextest -- --run-ignored all --no-fail-fast --test-threads 1
    
    • [ ] Ok(Default::default())
  • [ ] create tests if they aren't caught

Exactly the same flow for:

  • [ ] mine_block
 RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace BlockMinerThread::mine_block" -E ": replace .{1,2} with .{1,2} in " --baseline=skip --test-tool=nextest -- --run-ignored all --no-fail-fast --test-threads 1
  • [ ] lookup
  RUST_BACKTRACE=1 BITCOIND_TEST=1 cargo mutants -vV -F "replace ParentStacksBlockInfo::lookup" -E ": replace .{1,2} with .{1,2} in " --baseline=skip --test-tool=nextest -- --run-ignored all --no-fail-fast --test-threads 1

ASuciuX avatar Jun 04 '24 18:06 ASuciuX