diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9959ef6..2c1084f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -26,7 +26,10 @@ jobs: - name: Build run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal -l "console;verbosity=detailed" --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" --results-directory ./coverage + run: | + cdir=pwd + cd LNUnit.Tests + dotnet test -f net8.0 --filter FullyQualifiedName~LNUnit.Test --no-build --verbosity normal -l "console;verbosity=detailed" --collect:"XPlat Code Coverage" --logger "trx;LogFileName=test-results.trx" --results-directory $cdir/coverage - name: Test Report uses: dorny/test-reporter@v1 if: success() || failure() # run this step even if previous step failed diff --git a/LNUnit.Tests/AbcLightningFixture.cs b/LNUnit.Tests/AbcLightningFixture.cs index 1b7bbcf..27216cd 100644 --- a/LNUnit.Tests/AbcLightningFixture.cs +++ b/LNUnit.Tests/AbcLightningFixture.cs @@ -5,7 +5,6 @@ using Grpc.Core; using Lnrpc; using LNUnit.Extentions; -using LNUnit.Fixtures; using LNUnit.LND; using LNUnit.Setup; using Microsoft.Extensions.Caching.Memory; @@ -17,7 +16,7 @@ using ServiceStack.Text; using Assert = NUnit.Framework.Assert; -namespace LNUnit.Fixtures; +namespace LNUnit.Test.Fixtures; [TestFixture("postgres")] [TestFixture("boltdb")] diff --git a/LNUnit.Tests/Fixture/PostgresFixture.cs b/LNUnit.Tests/Fixture/PostgresFixture.cs index 7878577..97e9cf8 100644 --- a/LNUnit.Tests/Fixture/PostgresFixture.cs +++ b/LNUnit.Tests/Fixture/PostgresFixture.cs @@ -7,7 +7,7 @@ using Assert = NUnit.Framework.Assert; using HostConfig = Docker.DotNet.Models.HostConfig; -namespace LNUnit.Fixtures; +namespace LNUnit.Test.Fixtures; /// /// Used Globally to get Postgres support diff --git a/LNUnit/Setup/LNUnitBuilder.cs b/LNUnit/Setup/LNUnitBuilder.cs index 3168cf1..c1d068e 100644 --- a/LNUnit/Setup/LNUnitBuilder.cs +++ b/LNUnit/Setup/LNUnitBuilder.cs @@ -137,7 +137,7 @@ public async Task Build(bool setupNetwork = false, string lndRoot = "/home/lnd/. BitcoinRpcClient = new RPCClient("bitcoin:bitcoin", bitcoinNode.NetworkSettings.Networks.First().Value.IPAddress, Bitcoin.Instance.Regtest); WaitForBitcoinNodeStartupTimeout = 30000; - BitcoinRpcClient.HttpClient = new HttpClient() { Timeout = WaitForBitcoinNodeStartupTimeout }; + BitcoinRpcClient.HttpClient = new HttpClient() { Timeout = TimeSpan.FromMilliseconds(WaitForBitcoinNodeStartupTimeout) }; await BitcoinRpcClient.CreateWalletAsync("default", new CreateWalletOptions { LoadOnStartup = true }); var utxos = await BitcoinRpcClient.GenerateAsync(200); @@ -322,6 +322,11 @@ await GetTarStreamFromFS(n.DockerContainerId, foreach (var remoteNode in remotes) await ConnectPeers(localNode, remoteNode); } + while (LNDNodePool.ReadyNodes.Count < Configuration.LNDNodes.Count) + { + await Task.Delay(250); + if (cancelSource.IsCancellationRequested) throw new Exception("CANCELED"); + } //Setup Channels (this includes sending funds and waiting) foreach (var n in Configuration.LNDNodes) //TODO: can do multiple at once {