diff --git a/itest/list_exclude_test.go b/itest/list_exclude_test.go index fd0e1c03a..77a7d078e 100644 --- a/itest/list_exclude_test.go +++ b/itest/list_exclude_test.go @@ -13,7 +13,7 @@ import ( // be excluded from the test suite atm. // // TODO(yy): fix these tests and remove them from this list. -var excludedTestsWindows = []string{ +var excludedTestsWindows = append(append([]string{ "batch channel funding", "zero conf channel open", "open channel with unstable utxos", @@ -45,26 +45,12 @@ var excludedTestsWindows = []string{ "wipe forwarding packages", "coop close with htlcs", - "coop close with external delivery", "forward interceptor restart", "forward interceptor dedup htlcs", "invoice HTLC modifier basic", "lookup htlc resolution", - "remote signer-taproot", - "remote signer-account import", - "remote signer-bump fee", - "remote signer-funding input types", - "remote signer-funding async payments taproot", - "remote signer-funding async payments", - "remote signer-random seed", - "remote signer-verify msg", - "remote signer-channel open", - "remote signer-shared key", - "remote signer-psbt", - "remote signer-sign output raw", - "on chain to blinded", "query blinded route", @@ -76,7 +62,12 @@ var excludedTestsWindows = []string{ // more investigation is needed. "channel force close-anchor restart", "channel force close-simple taproot restart", -} +}, extractNames( + "coop close with external delivery", + coopCloseWithExternalTestCases)..., +), + extractNames("remote signer", remoteSignerTestCases)..., +) // filterWindowsFlakyTests filters out the flaky tests that are excluded from // the test suite on Windows. diff --git a/itest/list_on_test.go b/itest/list_on_test.go index 320f69f9e..88b7bb395 100644 --- a/itest/list_on_test.go +++ b/itest/list_on_test.go @@ -5,6 +5,7 @@ package itest import ( "fmt" + "github.com/lightningnetwork/lnd/fn/v2" "github.com/lightningnetwork/lnd/lntest" ) @@ -642,10 +643,6 @@ var allTestCases = []*lntest.TestCase{ Name: "sweep commit output and anchor", TestFunc: testSweepCommitOutputAndAnchor, }, - { - Name: "coop close with external delivery", - TestFunc: testCoopCloseWithExternalDelivery, - }, { Name: "payment failed htlc local swept", TestFunc: testPaymentFailedHTLCLocalSwept, @@ -720,6 +717,13 @@ func appendPrefixed(prefix string, testCases, return testCases } +// extractNames is used to extract tests' names from a group of prefixed tests. +func extractNames(prefix string, subtestCases []*lntest.TestCase) []string { + return fn.Map(subtestCases, func(tc *lntest.TestCase) string { + return fmt.Sprintf("%s-%s", prefix, tc.Name) + }) +} + func init() { // Register subtests. allTestCases = appendPrefixed( @@ -762,6 +766,10 @@ func init() { allTestCases = appendPrefixed( "wallet", allTestCases, walletTestCases, ) + allTestCases = appendPrefixed( + "coop close with external delivery", allTestCases, + coopCloseWithExternalTestCases, + ) // Prepare the test cases for windows to exclude some of the flaky // ones. diff --git a/itest/lnd_coop_close_external_delivery_test.go b/itest/lnd_coop_close_external_delivery_test.go index eea09a48d..e2c84fab1 100644 --- a/itest/lnd_coop_close_external_delivery_test.go +++ b/itest/lnd_coop_close_external_delivery_test.go @@ -2,7 +2,6 @@ package itest import ( "fmt" - "testing" "github.com/btcsuite/btcd/btcutil" "github.com/lightningnetwork/lnd/lnrpc" @@ -11,53 +10,50 @@ import ( "github.com/stretchr/testify/require" ) -func testCoopCloseWithExternalDelivery(ht *lntest.HarnessTest) { - ok := ht.Run("set P2WPKH delivery address at open", func(t *testing.T) { - tt := ht.Subtest(t) - testCoopCloseWithExternalDeliveryImpl( - tt, true, lnrpc.AddressType_UNUSED_WITNESS_PUBKEY_HASH, - ) - }) - // Abort the test if failed. - if !ok { - return - } - - ok = ht.Run("set P2WPKH delivery address at close", func(t *testing.T) { - tt := ht.Subtest(t) - testCoopCloseWithExternalDeliveryImpl( - tt, false, lnrpc.AddressType_UNUSED_WITNESS_PUBKEY_HASH, - ) - }) - // Abort the test if failed. - if !ok { - return - } - - ok = ht.Run("set P2TR delivery address at open", func(t *testing.T) { - tt := ht.Subtest(t) - testCoopCloseWithExternalDeliveryImpl( - tt, true, lnrpc.AddressType_UNUSED_TAPROOT_PUBKEY, - ) - }) - // Abort the test if failed. - if !ok { - return - } - - ht.Run("set P2TR delivery address at close", func(t *testing.T) { - tt := ht.Subtest(t) - testCoopCloseWithExternalDeliveryImpl( - tt, false, lnrpc.AddressType_UNUSED_TAPROOT_PUBKEY, - ) - }) +var coopCloseWithExternalTestCases = []*lntest.TestCase{ + { + Name: "set P2WPKH delivery address at open", + TestFunc: func(ht *lntest.HarnessTest) { + testCoopCloseWithExternalDelivery( + ht, true, + lnrpc.AddressType_UNUSED_WITNESS_PUBKEY_HASH, + ) + }, + }, + { + Name: "set P2WPKH delivery address at close", + TestFunc: func(ht *lntest.HarnessTest) { + testCoopCloseWithExternalDelivery( + ht, false, + lnrpc.AddressType_UNUSED_WITNESS_PUBKEY_HASH, + ) + }, + }, + { + Name: "set P2TR delivery address at open", + TestFunc: func(ht *lntest.HarnessTest) { + testCoopCloseWithExternalDelivery( + ht, true, + lnrpc.AddressType_UNUSED_TAPROOT_PUBKEY, + ) + }, + }, + { + Name: "set P2TR delivery address at close", + TestFunc: func(ht *lntest.HarnessTest) { + testCoopCloseWithExternalDelivery( + ht, false, + lnrpc.AddressType_UNUSED_TAPROOT_PUBKEY, + ) + }, + }, } -// testCoopCloseWithExternalDeliveryImpl ensures that we have a valid settled +// testCoopCloseWithExternalDelivery ensures that we have a valid settled // balance irrespective of whether the delivery address is in LND's wallet or // not. Some users set this value to be an address in a different wallet and // this should not affect our ability to accurately report the settled balance. -func testCoopCloseWithExternalDeliveryImpl(ht *lntest.HarnessTest, +func testCoopCloseWithExternalDelivery(ht *lntest.HarnessTest, upfrontShutdown bool, deliveryAddressType lnrpc.AddressType) { alice := ht.NewNodeWithCoins("Alice", nil)