rust-lightning icon indicating copy to clipboard operation
rust-lightning copied to clipboard

Refactor channelmanager tests into more appropriate submodule tests

Open srikanth-iyengar opened this issue 1 year ago • 9 comments

Fix #2958

Previously channelmanager had a single test module withint channelmanager.rs This changes introduces moving refactoring 23 tests of channelmanager into following test groups

Group 1: Key Send and Payment Verification

  1. test_keysend_dup_hash_partial_mpp
  2. test_keysend_dup_payment_hash
  3. test_keysend_hash_mismatch
  4. test_keysend_msg_with_secret_err
  5. bad_inbound_payment_hash
  6. reject_excessively_underpaying_htlcs
  7. test_final_incorrect_cltv
  8. test_payment_display
  9. test_malformed_forward_htlcs_ser

Group 2: Channel Management and Limits

  1. test_notify_limits
  2. test_drop_disconnected_peers_when_removing_channels
  3. test_outpoint_to_peer_coverage
  4. test_api_calls_with_unkown_counterparty_node
  5. test_api_calls_with_unavailable_channel
  6. test_connection_limiting
  7. test_outbound_chans_unlimited
  8. test_0conf_limiting
  9. test_trigger_lnd_force_close
  10. test_multi_hop_missing_secret

Group 3: Anchor Channel and Configuration Tests

  1. test_inbound_anchors_manual_acceptance
  2. test_anchors_zero_fee_htlc_tx_fallback
  3. test_update_channel_config

srikanth-iyengar avatar Mar 29 '24 14:03 srikanth-iyengar

Codecov Report

Attention: Patch coverage is 97.88315% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 89.77%. Comparing base (1890e80) to head (2e4f552). Report is 11 commits behind head on main.

Files Patch % Lines
lightning/src/ln/channelmanager_limits_tests.rs 97.63% 9 Missing and 4 partials :warning:
...tning/src/ln/anchor_channel_configuration_tests.rs 93.49% 8 Missing :warning:
lightning/src/ln/keysend_payments_tests.rs 99.21% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
- Coverage   89.82%   89.77%   -0.06%     
==========================================
  Files         116      119       +3     
  Lines       96466    96480      +14     
  Branches    96466    96480      +14     
==========================================
- Hits        86655    86615      -40     
- Misses       7264     7304      +40     
- Partials     2547     2561      +14     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 29 '24 14:03 codecov-commenter

Note that you'll probably have to rebase this after #2731 adds a new test.

Will take care of that for sure :+1:

srikanth-iyengar avatar Apr 02 '24 14:04 srikanth-iyengar

@TheBlueMatt updated changes from main after the merge of #2731 Took care of added test

srikanth-iyengar avatar Apr 05 '24 12:04 srikanth-iyengar

This might need a rebase by now - sorry!

tnull avatar May 14 '24 08:05 tnull

This might need a rebase by now - sorry!

Thanks, will rebase with main. do we have some new tests in channelmanager ? Asking so that I don't accidentally remove the tests

srikanth-iyengar avatar May 14 '24 12:05 srikanth-iyengar

Asking so that I don't accidentally remove the tests

If you do the move-only parts in a separate move-only commit it'll be pretty easy to see with git show --color-move --color-move-ws=ignore-space-change :)

TheBlueMatt avatar May 14 '24 13:05 TheBlueMatt

Rebased with main

srikanth-iyengar avatar May 14 '24 16:05 srikanth-iyengar

Looks like this needs rebase, sadly.

TheBlueMatt avatar Jun 17 '24 19:06 TheBlueMatt

Looks like this needs rebase, sadly.

oops..., I will try to complete this PR after this rebase

srikanth-iyengar avatar Jun 18 '24 04:06 srikanth-iyengar