Skip to content

Commit 637f84e

Browse files
Merge pull request #50 from richardschneider/ci-fail-2
seems happy now
2 parents 0c43cab + 718cdf3 commit 637f84e

File tree

5 files changed

+13
-35
lines changed

5 files changed

+13
-35
lines changed

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ environment:
3030

3131
# tools we need for bulding/testing/deploying
3232
install:
33+
- dotnet --version
3334
- choco install gitversion.portable -y
3435
- nuget update -self
3536
- choco install docfx -y

src/IpfsApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</PropertyGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Ipfs.Core" Version="0.35.0" />
30+
<PackageReference Include="Ipfs.Core" Version="0.35.2" />
3131
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
3232
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'netstandard14'" />
3333
<PackageReference Include="System.Net.Http" Version="4.3.3" Condition="'$(TargetFramework)' == 'net45'" />

test/CoreApi/DhtApiTest.cs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Linq;
55
using System.Text;
6+
using System.Threading;
67
using System.Threading.Tasks;
78

89
namespace Ipfs.Api
@@ -17,29 +18,17 @@ public class DhtApiTest
1718
public async Task FindPeer()
1819
{
1920
var ipfs = TestFixture.Ipfs;
20-
Peer node;
21-
foreach (var peer in await ipfs.Bootstrap.ListAsync())
22-
{
23-
try
24-
{
25-
node = await ipfs.Dht.FindPeerAsync(peer.PeerId);
26-
}
27-
catch (Exception)
28-
{
29-
continue;
30-
}
31-
32-
// If DHT can't find a peer, it will return a 'closer' peer.
33-
Assert.IsNotNull(peer);
34-
break;
35-
}
21+
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2));
22+
var mars = await ipfs.Dht.FindPeerAsync("QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", cts.Token);
23+
Assert.IsNotNull(mars);
3624
}
3725

3826
[TestMethod]
3927
public async Task FindProviders()
4028
{
4129
var ipfs = TestFixture.Ipfs;
42-
var providers = await ipfs.Dht.FindProvidersAsync(helloWorldID);
30+
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(2));
31+
var providers = await ipfs.Dht.FindProvidersAsync(helloWorldID, 1, cts.Token);
4332
Assert.AreNotEqual(0, providers.Count());
4433
}
4534

test/CoreApi/DnsApiTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public void Api_Exists()
2525
public async Task Resolve()
2626
{
2727
IpfsClient ipfs = TestFixture.Ipfs;
28-
var path = await ipfs.Dns.ResolveAsync("ipfs.io", recursive: true);
28+
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
29+
var path = await ipfs.Dns.ResolveAsync("ipfs.io", recursive: true, cancel: cts.Token);
2930
StringAssert.StartsWith(path, "/ipfs/");
3031
}
3132

test/CoreApi/GenericApiTest.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,9 @@ public void Local_Node_Info()
2020
[TestMethod]
2121
public async Task Peer_Node_Info()
2222
{
23-
var ipfs = TestFixture.Ipfs;
24-
Peer node;
25-
var peers = await ipfs.Bootstrap.ListAsync();
26-
foreach (var peer in peers)
27-
{
28-
try
29-
{
30-
node = await ipfs.IdAsync(peer.PeerId);
31-
}
32-
catch (Exception)
33-
{
34-
continue;
35-
}
36-
Assert.IsInstanceOfType(node, typeof(Peer));
37-
return;
38-
}
23+
var ipfs = TestFixture.Ipfs;
24+
var mars = await ipfs.IdAsync("QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3");
25+
Assert.IsNotNull(mars);
3926
}
4027

4128
[TestMethod]

0 commit comments

Comments
 (0)