Make sure CI doesn't run tests those require Tor
MODIFY
.travis.yml
.travis.yml
@@ -22,12 +22,7 @@ cache:
- $HOME/.nuget/packages
before_install:
- - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get -qq update && sudo apt-get install -y tor; else brew install tor; fi
- if [ $TRAVIS_OS_NAME = osx ]; then ulimit -S -n 4096; fi
- - echo $(sudo killall tor)
- - sleep 5
- - tor RunAsDaemon 1
script:
- - sleep 5
- - travis_wait dotnet test WalletWasabi.Tests/WalletWasabi.Tests.csproj
+ - travis_wait dotnet test WalletWasabi.Tests/WalletWasabi.Tests.csproj --filter Category=TorNotNeeded

MODIFY
WalletWasabi.Tests/CryptoTests.cs
WalletWasabi.Tests/CryptoTests.cs
@@ -18,6 +18,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CipherTests()
{
var toEncrypt = "hello";
@@ -51,6 +52,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void AuthenticateMessageTest()
{
var count = 0;
@@ -78,6 +80,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanBlindSign()
{
// generate rsa keypair
@@ -99,6 +102,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanSerialize()
{
var key = new BlindingRsaKey();
@@ -128,6 +132,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanEncodeDecodeBlinding()
{
var key = new BlindingRsaKey();

MODIFY
WalletWasabi.Tests/ExternalApiTests.cs
WalletWasabi.Tests/ExternalApiTests.cs
@@ -28,6 +28,7 @@ namespace WalletWasabi.Tests
[Theory]
[InlineData("test")]
[InlineData("main")]
+ [Trait("Category", "TorNotNeeded")]
public async Task SmartBitTestsAsync(string networkString)
{
if (!await TestAsync("https://api.smartbit.com.au/v1/blockchain/stats"))
@@ -52,6 +53,7 @@ namespace WalletWasabi.Tests
[Theory]
[InlineData("test")]
[InlineData("main")]
+ [Trait("Category", "TorNotNeeded")]
public async Task BlockCypherTestsAsync(string networkString)
{
if (!await TestAsync("https://api.blockcypher.com/v1/btc/main"))

MODIFY
WalletWasabi.Tests/KeyManagementTests.cs
WalletWasabi.Tests/KeyManagementTests.cs
@@ -19,6 +19,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanCreateNew()
{
string password = "password";
@@ -69,6 +70,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanRecover()
{
string password = "password";
@@ -86,6 +88,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanSerialize()
{
string password = "password";
@@ -127,6 +130,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void CanGenerateKeys()
{
string password = "password";

MODIFY
WalletWasabi.Tests/P2pTests.cs
WalletWasabi.Tests/P2pTests.cs
@@ -32,6 +32,7 @@ namespace WalletWasabi.Tests
[Theory]
[InlineData("test")]
[InlineData("main")]
+ [Trait("Category", "TorNotNeeded")]
public async Task TestServicesAsync(string networkString)
{
var network = Network.GetNetwork(networkString);
@@ -194,6 +195,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public async Task FilterBuilderTestAsync()
{
using (var builder = await NodeBuilder.CreateAsync())

MODIFY
WalletWasabi.Tests/RegTests.cs
WalletWasabi.Tests/RegTests.cs
@@ -81,6 +81,7 @@ namespace WalletWasabi.Tests
#region BackendTests
[Fact, TestPriority(1)]
+ [Trait("Category", "TorNotNeeded")]
public async Task GetExchangeRatesAsync()
{
using (var client = new TorHttpClient(new Uri(RegTestFixture.BackendEndPoint)))
@@ -98,6 +99,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(1)]
+ [Trait("Category", "TorNotNeeded")]
public async Task GetClientVersionAsync()
{
using (var client = new WasabiClient(new Uri(RegTestFixture.BackendEndPoint)))
@@ -109,6 +111,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(2)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BroadcastWithOutMinFeeAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -134,6 +137,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(3)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BroadcastReplayTxAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -154,6 +158,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(4)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BroadcastInvalidTxAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -176,6 +181,7 @@ namespace WalletWasabi.Tests
#region ServicesTests
[Fact, TestPriority(5)]
+ [Trait("Category", "TorNotNeeded")]
public async Task MempoolAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -224,6 +230,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(6)]
+ [Trait("Category", "TorNotNeeded")]
public async Task FilterDownloaderTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -279,6 +286,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(7)]
+ [Trait("Category", "TorNotNeeded")]
public async Task ReorgTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -413,6 +421,7 @@ namespace WalletWasabi.Tests
#region ClientTests
[Fact, TestPriority(8)]
+ [Trait("Category", "TorNotNeeded")]
public async Task WalletTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -647,6 +656,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(9)]
+ [Trait("Category", "TorNotNeeded")]
public async Task SendTestsFromHiddenWalletAsync() // These tests are taken from HiddenWallet, they were tests on the testnet.
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -1088,6 +1098,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(11)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BuildTransactionValidationsTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -1264,6 +1275,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(12)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BuildTransactionReorgsTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -1434,6 +1446,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(0)]
+ [Trait("Category", "TorNotNeeded")]
public async Task SpendUnconfirmedTxTestAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -1588,6 +1601,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(13)]
+ [Trait("Category", "TorNotNeeded")]
public async Task CcjCoordinatorCtorTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -1638,6 +1652,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(14)]
+ [Trait("Category", "TorNotNeeded")]
public async Task CcjTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -2107,6 +2122,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(19)]
+ [Trait("Category", "TorNotNeeded")]
public async Task BanningTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -2242,6 +2258,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(15)]
+ [Trait("Category", "TorNotNeeded")]
public async Task Ccj100ParticipantsTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -2450,6 +2467,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(16)]
+ [Trait("Category", "TorNotNeeded")]
public async Task CcjClientTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -2562,6 +2580,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(17)]
+ [Trait("Category", "TorNotNeeded")]
public async Task CcjClientCustomOutputScriptTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(1);
@@ -2658,6 +2677,7 @@ namespace WalletWasabi.Tests
}
[Fact, TestPriority(18)]
+ [Trait("Category", "TorNotNeeded")]
public async Task CoinJoinMultipleRoundTestsAsync()
{
(string password, RPCClient rpc, Network network, CcjCoordinator coordinator) = await InitializeTestEnvironmentAsync(3);

MODIFY
WalletWasabi.Tests/RpcMethodTests.cs
WalletWasabi.Tests/RpcMethodTests.cs
@@ -34,6 +34,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public async Task CanWaitForBlockFromRpcAsync()
{
using (var builder = await NodeBuilder.CreateAsync())

MODIFY
WalletWasabi.Tests/SmartModelTests.cs
WalletWasabi.Tests/SmartModelTests.cs
@@ -20,6 +20,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void SmartTransactionEquality()
{
var tx = Network.TestNet.Consensus.ConsensusFactory.CreateTransaction();
@@ -46,6 +47,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void SmartCoinEquality()
{
var tx = Network.TestNet.Consensus.ConsensusFactory.CreateTransaction();
@@ -76,6 +78,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void SmartTransactionSerialization()
{
var tx = Network.TestNet.Consensus.ConsensusFactory.CreateTransaction();
@@ -113,6 +116,7 @@ namespace WalletWasabi.Tests
}
[Fact]
+ [Trait("Category", "TorNotNeeded")]
public void SmartCoinSerialization()
{
var tx = Network.TestNet.Consensus.ConsensusFactory.CreateTransaction();

MODIFY
appveyor.yml
appveyor.yml
@@ -7,12 +7,6 @@ skip_branch_with_pr: true
cache:
- '%USERPROFILE%\.nuget\packages -> **\*.csproj'
- '%APPDATA%\WalletWasabi'
-- Tor
-
-install:
- - if not exist Tor\tor.exe appveyor DownloadFile https://dist.torproject.org/torbrowser/7.5.3/tor-win32-0.3.2.10.zip
- - if not exist Tor\tor.exe 7z x tor-win32-0.3.2.10.zip
- - ps: $TorProcess = Start-Process tor\tor.exe -PassThru
before_build:
- git submodule update --init --recursive
@@ -23,7 +17,4 @@ build_script:
test_script:
- cd WalletWasabi.Tests
- - dotnet test /p:CollectCoverage=true
-
-on_finish:
- - ps: Stop-Process -Id $TorProcess.Id
+ - dotnet test --filter Category=TorNotNeeded

Make sure CI doesn't run tests those require Tor