Skip to content
Snippets Groups Projects
Commit c152d662 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

fix warnings in integration tests

parent b8c77c59
No related branches found
No related tags found
No related merge requests found
Showing
with 23 additions and 17 deletions
......@@ -10,6 +10,7 @@
<PackageId>Grpc.IntegrationTesting.Client</PackageId>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
......
......@@ -11,6 +11,7 @@
<ServerGarbageCollection>true</ServerGarbageCollection>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
......
......@@ -10,6 +10,7 @@
<PackageId>Grpc.IntegrationTesting.Server</PackageId>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
......
......@@ -10,6 +10,7 @@
<PackageId>Grpc.IntegrationTesting.StressClient</PackageId>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
......
......@@ -42,7 +42,7 @@ namespace Grpc.IntegrationTesting
Channel channel;
TestService.TestServiceClient client;
[TestFixtureSetUp]
[OneTimeSetUp]
public void Init()
{
// Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
......@@ -57,7 +57,7 @@ namespace Grpc.IntegrationTesting
client = new TestService.TestServiceClient(channel);
}
[TestFixtureTearDown]
[OneTimeTearDown]
public void Cleanup()
{
channel.ShutdownAsync().Wait();
......@@ -108,7 +108,7 @@ namespace Grpc.IntegrationTesting
private class CustomErrorDetailsTestServiceImpl : TestService.TestServiceBase
{
public override async Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context)
public override Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context)
{
try
{
......
......@@ -65,7 +65,7 @@ namespace Grpc.IntegrationTesting
}
[Test]
public async Task UnimplementedByDefault_ClientStreaming()
public void UnimplementedByDefault_ClientStreaming()
{
var call = client.StreamingInputCall();
......@@ -74,7 +74,7 @@ namespace Grpc.IntegrationTesting
}
[Test]
public async Task UnimplementedByDefault_ServerStreamingCall()
public void UnimplementedByDefault_ServerStreamingCall()
{
var call = client.StreamingOutputCall(new StreamingOutputCallRequest());
......@@ -83,7 +83,7 @@ namespace Grpc.IntegrationTesting
}
[Test]
public async Task UnimplementedByDefault_DuplexStreamingCall()
public void UnimplementedByDefault_DuplexStreamingCall()
{
var call = client.FullDuplexCall();
......
......@@ -10,6 +10,7 @@
<PackageId>Grpc.IntegrationTesting</PackageId>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45</PackageTargetFallback>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.0.4</RuntimeFrameworkVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
......
......@@ -38,7 +38,7 @@ namespace Grpc.IntegrationTesting
Channel channel;
TestService.TestServiceClient client;
[TestFixtureSetUp]
[OneTimeSetUp]
public void Init()
{
// Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755
......@@ -58,7 +58,7 @@ namespace Grpc.IntegrationTesting
client = new TestService.TestServiceClient(channel);
}
[TestFixtureTearDown]
[OneTimeTearDown]
public void Cleanup()
{
channel.ShutdownAsync().Wait();
......
......@@ -35,7 +35,7 @@ namespace Grpc.IntegrationTesting
{
IServerRunner serverRunner;
[TestFixtureSetUp]
[OneTimeSetUp]
public void Init()
{
var serverConfig = new ServerConfig
......@@ -45,7 +45,7 @@ namespace Grpc.IntegrationTesting
serverRunner = ServerRunners.CreateStarted(serverConfig);
}
[TestFixtureTearDown]
[OneTimeTearDown]
public void Cleanup()
{
serverRunner.StopAsync().Wait();
......
......@@ -41,7 +41,7 @@ namespace Grpc.IntegrationTesting
Channel channel;
TestService.TestServiceClient client;
[TestFixtureSetUp]
[OneTimeSetUp]
public void Init()
{
var rootCert = File.ReadAllText(TestCredentials.ClientCertAuthorityPath);
......@@ -69,7 +69,7 @@ namespace Grpc.IntegrationTesting
client = new TestService.TestServiceClient(channel);
}
[TestFixtureTearDown]
[OneTimeTearDown]
public void Cleanup()
{
channel.ShutdownAsync().Wait();
......@@ -94,15 +94,15 @@ namespace Grpc.IntegrationTesting
private class SslCredentialsTestServiceImpl : TestService.TestServiceBase
{
public override async Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context)
public override Task<SimpleResponse> UnaryCall(SimpleRequest request, ServerCallContext context)
{
return new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) };
return Task.FromResult(new SimpleResponse { Payload = CreateZerosPayload(request.ResponseSize) });
}
public override async Task<StreamingInputCallResponse> StreamingInputCall(IAsyncStreamReader<StreamingInputCallRequest> requestStream, ServerCallContext context)
{
var authContext = context.AuthContext;
await requestStream.ForEachAsync(async request => {});
await requestStream.ForEachAsync(request => TaskUtils.CompletedTask);
Assert.IsTrue(authContext.IsPeerAuthenticated);
Assert.AreEqual("x509_subject_alternative_name", authContext.PeerIdentityPropertyName);
......
......@@ -63,9 +63,10 @@ namespace Grpc.Testing
await EnsureEchoMetadataAsync(context);
int sum = 0;
await requestStream.ForEachAsync(async request =>
await requestStream.ForEachAsync(request =>
{
sum += request.Payload.Body.Length;
return TaskUtils.CompletedTask;
});
return new StreamingInputCallResponse { AggregatedPayloadSize = sum };
}
......@@ -85,7 +86,7 @@ namespace Grpc.Testing
});
}
public override async Task HalfDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context)
public override Task HalfDuplexCall(IAsyncStreamReader<StreamingOutputCallRequest> requestStream, IServerStreamWriter<StreamingOutputCallResponse> responseStream, ServerCallContext context)
{
throw new NotImplementedException();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment