Skip to content

Commit

Permalink
Merge pull request #800 from lightninglabs/itest-uni-server-lnd-node
Browse files Browse the repository at this point in the history
itest: universe server harness uses a dedicated LND node
  • Loading branch information
ffranr authored Feb 14, 2024
2 parents ac8a237 + 5d52f63 commit 783b7b3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
15 changes: 14 additions & 1 deletion itest/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ func TestTaprootAssetsDaemon(t *testing.T) {

lndHarness.SetupStandbyNodes()

// Create a new LND node for use with the universe server.
t.Log("Starting universe server LND node")
uniServerLndHarness := lndHarness.NewNode("uni-server-lnd", nil)

// Wait for the new LND node to be fully synced to the blockchain.
lndHarness.WaitForBlockchainSync(uniServerLndHarness)

t.Logf("Running %v integration tests", len(testList))
for _, testCase := range testList {
logLine := fmt.Sprintf("STARTING ============ %v ============\n",
Expand All @@ -60,12 +67,18 @@ func TestTaprootAssetsDaemon(t *testing.T) {
// created and later discarded for each test run to
// assure no state is taken over between runs.
tapdHarness, uniHarness, proofCourier := setupHarnesses(
t1, ht, lndHarness,
t1, ht, lndHarness, uniServerLndHarness,
testCase.proofCourierType,
)
lndHarness.EnsureConnected(
lndHarness.Alice, lndHarness.Bob,
)
lndHarness.EnsureConnected(
lndHarness.Alice, uniServerLndHarness,
)
lndHarness.EnsureConnected(
lndHarness.Bob, uniServerLndHarness,
)

lndHarness.Alice.AddToLogf(logLine)
lndHarness.Bob.AddToLogf(logLine)
Expand Down
6 changes: 4 additions & 2 deletions itest/test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,13 @@ func nextAvailablePort() int {
// setupHarnesses creates new server and client harnesses that are connected
// to each other through an in-memory gRPC connection.
func setupHarnesses(t *testing.T, ht *harnessTest,
lndHarness *lntest.HarnessTest,
lndHarness *lntest.HarnessTest, uniServerLndHarness *node.HarnessNode,
proofCourierType proof.CourierType) (*tapdHarness,
*universeServerHarness, proof.CourierHarness) {

universeServer := newUniverseServerHarness(t, ht, lndHarness.Bob)
// Create a new universe server harness and start it.
t.Log("Starting universe server harness")
universeServer := newUniverseServerHarness(t, ht, uniServerLndHarness)

t.Logf("Starting universe server harness, listening on %v",
universeServer.ListenAddr)
Expand Down
5 changes: 5 additions & 0 deletions itest/universe_server_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ type universeServerHarness struct {

// ListenAddr is the address that the service is listening on.
ListenAddr string

// lndHarness is the instance of the lnd harness that the service is
// using.
LndHarness *node.HarnessNode
}

func newUniverseServerHarness(t *testing.T, ht *harnessTest,
Expand All @@ -28,6 +32,7 @@ func newUniverseServerHarness(t *testing.T, ht *harnessTest,
return &universeServerHarness{
service: service,
ListenAddr: service.rpcHost(),
LndHarness: lndHarness,
}
}

Expand Down

0 comments on commit 783b7b3

Please sign in to comment.