Skip to content

Replace manual node reloading with a macro/function in tests - #1853

Merged
TheBlueMatt merged 2 commits into
lightningdevkit:mainfrom
TheBlueMatt:2022-11-reload-macro
Nov 16, 2022
Merged

TheBlueMatt merged 2 commits into
lightningdevkit:mainfrom
TheBlueMatt:2022-11-reload-macro

Conversation

@TheBlueMatt

Copy link
Copy Markdown
Collaborator

Fixes #1696

@codecov-commenter

codecov-commenter commented Nov 15, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 90.68% // Head: 90.68% // No change to project coverage 👍

Coverage data is based on head (8d8ee55) compared to base (8d8ee55).
Patch has no changes to coverable lines.

❗ Current head 8d8ee55 differs from pull request most recent head 97b210d. Consider uploading reports for the commit 97b210d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1853   +/-   ##
=======================================
  Coverage   90.68%   90.68%           
=======================================
  Files          89       89           
  Lines       47947    47947           
  Branches    47947    47947           
=======================================
  Hits        43481    43481           
  Misses       4466     4466           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

dunxen
dunxen previously approved these changes Nov 15, 2022

@dunxen dunxen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, basically LGTM! And the added bonus of taming the functional_tests behemoth a bit :D

@wpaulino wpaulino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread lightning/src/ln/payment_tests.rs Resolved
@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Restored the previous default-config:

$ git diff-tree -U1 017901def ef7910590
diff --git a/lightning/src/ln/payment_tests.rs b/lightning/src/ln/payment_tests.rs
index 1d9d27568..ade02c48c 100644
--- a/lightning/src/ln/payment_tests.rs
+++ b/lightning/src/ln/payment_tests.rs
@@ -574,3 +574,3 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
 
-	reload_node!(nodes[0], nodes_0_serialized, &[&chan_0_monitor_serialized], first_persister, first_new_chain_monitor, first_nodes_0_deserialized);
+	reload_node!(nodes[0], test_default_channel_config(), nodes_0_serialized, &[&chan_0_monitor_serialized], first_persister, first_new_chain_monitor, first_nodes_0_deserialized);
 	nodes[1].node.peer_disconnected(&nodes[0].node.get_our_node_id(), false);
@@ -666,3 +666,3 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
 
-	reload_node!(nodes[0], nodes_0_serialized, &[&chan_0_monitor_serialized, &chan_1_monitor_serialized], second_persister, second_new_chain_monitor, second_nodes_0_deserialized);
+	reload_node!(nodes[0], test_default_channel_config(), nodes_0_serialized, &[&chan_0_monitor_serialized, &chan_1_monitor_serialized], second_persister, second_new_chain_monitor, second_nodes_0_deserialized);
 	nodes[1].node.peer_disconnected(&nodes[0].node.get_our_node_id(), false);
@@ -686,3 +686,3 @@ fn do_test_completed_payment_not_retryable_on_reload(use_dust: bool) {
 	// Ensure that after reload we cannot retry the payment.
-	reload_node!(nodes[0], nodes_0_serialized, &[&chan_0_monitor_serialized, &chan_1_monitor_serialized], third_persister, third_new_chain_monitor, third_nodes_0_deserialized);
+	reload_node!(nodes[0], test_default_channel_config(), nodes_0_serialized, &[&chan_0_monitor_serialized, &chan_1_monitor_serialized], third_persister, third_new_chain_monitor, third_nodes_0_deserialized);
 	nodes[1].node.peer_disconnected(&nodes[0].node.get_our_node_id(), false);

dunxen
dunxen previously approved these changes Nov 15, 2022
wpaulino
wpaulino previously approved these changes Nov 15, 2022
@TheBlueMatt
TheBlueMatt dismissed stale reviews from wpaulino and dunxen via 97b210d November 15, 2022 22:38
@TheBlueMatt

Copy link
Copy Markdown
Collaborator Author

Grr, sorry, had to rebase to address a trivial conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DRY/Macro-ize the node reload logic in functional tests

4 participants