solana icon indicating copy to clipboard operation
solana copied to clipboard

harden cli tests

Open tao-stones opened this issue 5 months ago • 1 comments

Problem

TestValidator can be created with custom specified target_lamportds_per_signature

    pub fn with_custom_fees(
        mint_address: Pubkey,
        target_lamports_per_signature: u64,
        faucet_addr: Option<SocketAddr>,
        socket_addr_space: SocketAddrSpace,
    ) -> Self 

Cli tests uses with_custom_fees() but with target_lamports_per_signature == 1. This works accidentally because calculate_fee() currently uses fee_structure's default lamports_per_signature so long fee_rate_governor.lamport_per_signature <> 0.

Calculate_fee() is going to change (eg. be corrected). But in any case, cli tests should use correct value in setting up TestValidator.

Summary of Changes

  • setting up TestValidator with correct target_lamports_per_signature

Fixes #

tao-stones avatar Jan 18 '24 21:01 tao-stones

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8f9d915) 81.8% compared to head (2dc88e2) 81.7%. Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34844     +/-   ##
=========================================
- Coverage    81.8%    81.7%   -0.1%     
=========================================
  Files         825      825             
  Lines      223269   223269             
=========================================
- Hits       182635   182627      -8     
- Misses      40634    40642      +8     

codecov[bot] avatar Jan 18 '24 22:01 codecov[bot]