Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itest: universe server harness uses a dedicated LND node #800

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading