fix warnings in integration tests

pull/12127/head
Jan Tattermusch 8 years ago
parent b8c77c59c5
commit c152d6628a
  1. 1
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
  2. 1
      src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
  3. 1
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
  4. 1
      src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj
  5. 6
      src/csharp/Grpc.IntegrationTesting/CustomErrorDetailsTest.cs
  6. 6
      src/csharp/Grpc.IntegrationTesting/GeneratedServiceBaseTest.cs
  7. 1
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  8. 4
      src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
  9. 4
      src/csharp/Grpc.IntegrationTesting/RunnerClientServerTest.cs
  10. 10
      src/csharp/Grpc.IntegrationTesting/SslCredentialsTest.cs
  11. 5
      src/csharp/Grpc.IntegrationTesting/TestServiceImpl.cs

@ -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();
}

Loading…
Cancel
Save