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

Organize Tests (MempoolStore Breakdown Part 1) #2197

Merged
merged 4 commits into from Sep 1, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -55,11 +55,11 @@ public async Task InitializeAsync(Config config, CcjRoundConfig roundConfig, RPC
await InitializeP2pAsync(config.Network, config.GetBitcoinP2pEndPoint());

// Initialize index building
var indexBuilderServiceDir = Path.Combine(DataDir, nameof(IndexBuilderService));
var indexBuilderServiceDir = Path.Combine(DataDir, "IndexBuilderService");
var indexFilePath = Path.Combine(indexBuilderServiceDir, $"Index{RpcClient.Network}.dat");
var utxoSetFilePath = Path.Combine(indexBuilderServiceDir, $"UtxoSet{RpcClient.Network}.dat");
IndexBuilderService = new IndexBuilderService(RpcClient, TrustedNodeNotifyingBehavior, indexFilePath, utxoSetFilePath);
Coordinator = new CcjCoordinator(RpcClient.Network, TrustedNodeNotifyingBehavior, Path.Combine(DataDir, nameof(CcjCoordinator)), RpcClient, roundConfig);
Coordinator = new CcjCoordinator(RpcClient.Network, TrustedNodeNotifyingBehavior, Path.Combine(DataDir, "CcjCoordinator"), RpcClient, roundConfig);
IndexBuilderService.Synchronize();
Logger.LogInfo<IndexBuilderService>($"{nameof(IndexBuilderService)} is successfully initialized and started synchronization.");

@@ -204,7 +204,7 @@ private async Task AssertRpcNodeFullyInitializedAsync()
var generateBlocksResponse = await RpcClient.GenerateAsync(101);
if (generateBlocksResponse is null)
{
throw new NotSupportedException($"Bitcoin Core cannot generate blocks on the {nameof(Network.RegTest)}.");
throw new NotSupportedException($"Bitcoin Core cannot generate blocks on the {Network.RegTest}.");
}

blockchainInfo = await RpcClient.GetBlockchainInfoAsync();
@@ -213,7 +213,7 @@ private async Task AssertRpcNodeFullyInitializedAsync()
{
throw new NotSupportedException($"{nameof(blocks)} == 0");
}
Logger.LogInfo<RPCClient>($"Generated 101 block on {nameof(Network.RegTest)}. Number of blocks {blocks}.");
Logger.LogInfo<RPCClient>($"Generated 101 block on {Network.RegTest}. Number of blocks {blocks}.");
}
}
}
@@ -7,7 +7,7 @@
using WalletWasabi.Services;
using Xunit;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
public class ExtPubKeyExplorerTests
{
@@ -14,7 +14,7 @@
using WalletWasabi.WebClients.SmartBit.Models;
using Xunit;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
public class ExternalApiTests
{
@@ -12,7 +12,7 @@
using WalletWasabi.WebClients.Wasabi.ChaumianCoinJoin;
using Xunit;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
[Collection("LiveServerTests collection")]
public class LiveServerTests
@@ -21,7 +21,7 @@
using WalletWasabi.Tests.XunitConfiguration;
using Xunit;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
public class P2pTests
{
@@ -86,7 +86,7 @@ public async Task TestServicesAsync(string networkString)
var nodes = new NodesGroup(network, connectionParameters, requirements: Constants.NodeRequirements);

BitcoinStore bitcoinStore = new BitcoinStore();
await bitcoinStore.InitializeAsync(Path.Combine(Global.Instance.DataDir, nameof(TestServicesAsync)), network);
await bitcoinStore.InitializeAsync(Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName()), network);

KeyManager keyManager = KeyManager.CreateNew(out _, "password");
WasabiSynchronizer syncer = new WasabiSynchronizer(network, bitcoinStore, new Uri("http://localhost:12345"), Global.Instance.TorSocks5Endpoint);
@@ -37,7 +37,7 @@
using Xunit;
using static NBitcoin.Crypto.SchnorrBlinding;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
[Collection("RegTest collection")]
public class RegTests
@@ -164,7 +164,7 @@ public async Task FilterBuilderTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator, ServiceConfiguration serviceConfiguration, BitcoinStore bitcoinStore, Backend.Global global) = await InitializeTestEnvironmentAsync(1);

var indexBuilderServiceDir = Path.Combine(Global.Instance.DataDir, nameof(IndexBuilderService));
var indexBuilderServiceDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var indexFilePath = Path.Combine(indexBuilderServiceDir, $"Index{rpc.Network}.dat");
var utxoSetFilePath = Path.Combine(indexBuilderServiceDir, $"UtxoSet{rpc.Network}.dat");

@@ -543,7 +543,7 @@ public async Task WalletTestsAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 5. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(WalletTestsAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -774,7 +774,7 @@ public async Task SendTestsAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(SendTestsAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -1247,7 +1247,7 @@ public async Task BuildTransactionValidationsTestAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(BuildTransactionValidationsTestAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -1410,7 +1410,7 @@ public async Task BuildTransactionReorgsTestAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(BuildTransactionReorgsTestAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -1573,7 +1573,7 @@ public async Task SpendUnconfirmedTxTestAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(SpendUnconfirmedTxTestAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -1741,7 +1741,7 @@ public async Task ReplaceByFeeTxTestAsync()
var chaumianClient = new CcjClient(synchronizer, rpc.Network, keyManager, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(ReplaceByFeeTxTestAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

@@ -1838,7 +1838,7 @@ public async Task CcjCoordinatorCtorTestsAsync()
var offchainTxId = network.Consensus.ConsensusFactory.CreateTransaction().GetHash();
var mempoolTxId = rpc.SendToAddress(new Key().PubKey.GetSegwitAddress(network), Money.Coins(1));

var folder = Path.Combine(Global.Instance.DataDir, nameof(CcjCoordinatorCtorTestsAsync));
var folder = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
await IoHelpers.DeleteRecursivelyWithMagicDustAsync(folder);
Directory.CreateDirectory(folder);
var cjfile = Path.Combine(folder, $"CoinJoins{network}.txt");
@@ -3356,7 +3356,7 @@ public async Task CoinJoinMultipleRoundTestsAsync()
// 3. Create wasabi synchronizer service.
var synchronizer = new WasabiSynchronizer(network, bitcoinStore, new Uri(RegTestFixture.BackendEndPoint), null);

var indexFilePath2 = Path.Combine(Global.Instance.DataDir, nameof(CoinJoinMultipleRoundTestsAsync), $"Index{network}2.dat");
var indexFilePath2 = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName(), $"Index{network}2.dat");
var synchronizer2 = new WasabiSynchronizer(network, bitcoinStore, new Uri(RegTestFixture.BackendEndPoint), null);

// 4. Create key manager service.
@@ -3370,11 +3370,11 @@ public async Task CoinJoinMultipleRoundTestsAsync()
var chaumianClient2 = new CcjClient(synchronizer, network, keyManager2, new Uri(RegTestFixture.BackendEndPoint), null);

// 6. Create wallet service.
var workDir = Path.Combine(Global.Instance.DataDir, nameof(CoinJoinMultipleRoundTestsAsync));
var workDir = Path.Combine(Global.Instance.DataDir, EnvironmentHelpers.GetMethodName());
var wallet = new WalletService(bitcoinStore, keyManager, synchronizer, chaumianClient, mempoolService, nodes, workDir, serviceConfiguration);
wallet.NewFilterProcessed += Wallet_NewFilterProcessed;

var workDir2 = Path.Combine(Global.Instance.DataDir, $"{nameof(CoinJoinMultipleRoundTestsAsync)}2");
var workDir2 = Path.Combine(Global.Instance.DataDir, $"{EnvironmentHelpers.GetMethodName()}2");
var wallet2 = new WalletService(bitcoinStore, keyManager2, synchronizer2, chaumianClient2, mempoolService2, nodes2, workDir2, serviceConfiguration);

// Get some money, make it confirm.
@@ -9,7 +9,7 @@
using WalletWasabi.TorSocks5;
using Xunit;

namespace WalletWasabi.Tests
namespace WalletWasabi.Tests.IntegrationTests
{
// Tor must be running
public class TorTests
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.