From 0d57ff2432eb4839684d857057f596208812fdda Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 10 Dec 2020 15:51:41 -0800 Subject: [PATCH] lnwallet/test: execute ifacet tests for each backend in parallel --- lnwallet/test/bitcoind/bitcoind_test.go | 13 +++++++++++++ lnwallet/test/btcd/btcd_test.go | 13 +++++++++++++ lnwallet/test/neutrino/neutrino_test.go | 13 +++++++++++++ .../test/{interface_test.go => test_interface.go} | 8 ++++++-- 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 lnwallet/test/bitcoind/bitcoind_test.go create mode 100644 lnwallet/test/btcd/btcd_test.go create mode 100644 lnwallet/test/neutrino/neutrino_test.go rename lnwallet/test/{interface_test.go => test_interface.go} (99%) diff --git a/lnwallet/test/bitcoind/bitcoind_test.go b/lnwallet/test/bitcoind/bitcoind_test.go new file mode 100644 index 00000000..a5df2528 --- /dev/null +++ b/lnwallet/test/bitcoind/bitcoind_test.go @@ -0,0 +1,13 @@ +package bitcoind_test + +import ( + "testing" + + lnwallettest "github.com/lightningnetwork/lnd/lnwallet/test" +) + +// TestLightningWallet tests LightningWallet powered by bitcoind against our +// suite of interface tests. +func TestLightningWallet(t *testing.T) { + lnwallettest.TestLightningWallet(t, "bitcoind") +} diff --git a/lnwallet/test/btcd/btcd_test.go b/lnwallet/test/btcd/btcd_test.go new file mode 100644 index 00000000..c18b0e5f --- /dev/null +++ b/lnwallet/test/btcd/btcd_test.go @@ -0,0 +1,13 @@ +package btcd_test + +import ( + "testing" + + lnwallettest "github.com/lightningnetwork/lnd/lnwallet/test" +) + +// TestLightningWallet tests LightningWallet powered by btcd against our suite +// of interface tests. +func TestLightningWallet(t *testing.T) { + lnwallettest.TestLightningWallet(t, "btcd") +} diff --git a/lnwallet/test/neutrino/neutrino_test.go b/lnwallet/test/neutrino/neutrino_test.go new file mode 100644 index 00000000..c3631c83 --- /dev/null +++ b/lnwallet/test/neutrino/neutrino_test.go @@ -0,0 +1,13 @@ +package neutrino_test + +import ( + "testing" + + lnwallettest "github.com/lightningnetwork/lnd/lnwallet/test" +) + +// TestLightningWallet tests LightningWallet powered by neutrino against our +// suite of interface tests. +func TestLightningWallet(t *testing.T) { + lnwallettest.TestLightningWallet(t, "neutrino") +} diff --git a/lnwallet/test/interface_test.go b/lnwallet/test/test_interface.go similarity index 99% rename from lnwallet/test/interface_test.go rename to lnwallet/test/test_interface.go index 771c1692..52c9522a 100644 --- a/lnwallet/test/interface_test.go +++ b/lnwallet/test/test_interface.go @@ -1,4 +1,4 @@ -package lnwallettest_test +package lnwallettest import ( "bytes" @@ -3086,7 +3086,7 @@ func testSingleFunderExternalFundingTx(miner *rpctest.Harness, // below needs to be added which properly initializes the interface. // // TODO(roasbeef): purge bobNode in favor of dual lnwallet's -func TestLightningWallet(t *testing.T) { +func TestLightningWallet(t *testing.T, targetBackEnd string) { t.Parallel() // Initialize the harness around a btcd node which will serve as our @@ -3140,6 +3140,10 @@ func TestLightningWallet(t *testing.T) { for _, walletDriver := range lnwallet.RegisteredWallets() { for _, backEnd := range walletDriver.BackEnds() { + if backEnd != targetBackEnd { + continue + } + if !runTests(t, walletDriver, backEnd, miningNode, rpcConfig, chainNotifier) { return