From b309163ceae4690e049f71fcf5e107fc11d4a689 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Fri, 22 May 2020 13:31:45 +1200 Subject: [PATCH 1/2] Support disabling individual gRPC interop tests --- src/Grpc/test/InteropTests/InteropTests.cs | 51 +++++++++------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/src/Grpc/test/InteropTests/InteropTests.cs b/src/Grpc/test/InteropTests/InteropTests.cs index 2a9a1f66d771..667eb1c3dcc3 100644 --- a/src/Grpc/test/InteropTests/InteropTests.cs +++ b/src/Grpc/test/InteropTests/InteropTests.cs @@ -25,9 +25,26 @@ public InteropTests(ITestOutputHelper output) _output = output; } - [Theory] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/22101")] - [MemberData(nameof(TestCaseData))] + // All interop test cases, minus GCE authentication specific tests + [ConditionalTheory] + [InlineData("empty_unary")] + [InlineData("large_unary")] + [InlineData("client_streaming")] + [InlineData("server_streaming")] + [InlineData("ping_pong", Skip = "https://github.com/dotnet/aspnetcore/issues/22101")] + [InlineData("empty_stream")] + [InlineData("cancel_after_begin")] + [InlineData("cancel_after_first_response")] + [InlineData("timeout_on_sleeping_server")] + [InlineData("custom_metadata")] + [InlineData("status_code_and_message")] + [InlineData("special_status_message")] + [InlineData("unimplemented_service")] + [InlineData("unimplemented_method")] + [InlineData("client_compressed_unary")] + [InlineData("client_compressed_streaming")] + [InlineData("server_compressed_unary")] + [InlineData("server_compressed_streaming")] public async Task InteropTestCase(string name) { using (var serverProcess = new WebsiteProcess(_serverPath, _output)) @@ -44,33 +61,5 @@ public async Task InteropTestCase(string name) } } } - - #region TestData - // All interop test cases, minus GCE authentication specific tests - private static string[] AllTests = new string[] - { - "empty_unary", - "large_unary", - "client_streaming", - "server_streaming", - "ping_pong", - "empty_stream", - - "cancel_after_begin", - "cancel_after_first_response", - "timeout_on_sleeping_server", - "custom_metadata", - "status_code_and_message", - "special_status_message", - "unimplemented_service", - "unimplemented_method", - "client_compressed_unary", - "client_compressed_streaming", - "server_compressed_unary", - "server_compressed_streaming" - }; - - public static IEnumerable TestCaseData => AllTests.Select(t => new object[] { t }); - #endregion } } From afabdeaf16f8fb47145fdfe588e42cbf256584a7 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Fri, 22 May 2020 14:17:45 +1200 Subject: [PATCH 2/2] PR feedback --- src/Grpc/test/InteropTests/InteropTests.cs | 79 ++++++++++++++++------ 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/src/Grpc/test/InteropTests/InteropTests.cs b/src/Grpc/test/InteropTests/InteropTests.cs index 667eb1c3dcc3..4fce98ff786d 100644 --- a/src/Grpc/test/InteropTests/InteropTests.cs +++ b/src/Grpc/test/InteropTests/InteropTests.cs @@ -13,6 +13,8 @@ namespace InteropTests { + // All interop test cases, minus GCE authentication specific tests. + // Tests are separate methods so that they can be quarantined separately. public class InteropTests { private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30); @@ -25,27 +27,62 @@ public InteropTests(ITestOutputHelper output) _output = output; } - // All interop test cases, minus GCE authentication specific tests - [ConditionalTheory] - [InlineData("empty_unary")] - [InlineData("large_unary")] - [InlineData("client_streaming")] - [InlineData("server_streaming")] - [InlineData("ping_pong", Skip = "https://github.com/dotnet/aspnetcore/issues/22101")] - [InlineData("empty_stream")] - [InlineData("cancel_after_begin")] - [InlineData("cancel_after_first_response")] - [InlineData("timeout_on_sleeping_server")] - [InlineData("custom_metadata")] - [InlineData("status_code_and_message")] - [InlineData("special_status_message")] - [InlineData("unimplemented_service")] - [InlineData("unimplemented_method")] - [InlineData("client_compressed_unary")] - [InlineData("client_compressed_streaming")] - [InlineData("server_compressed_unary")] - [InlineData("server_compressed_streaming")] - public async Task InteropTestCase(string name) + [Fact] + public Task EmptyUnary() => InteropTestCase("empty_unary"); + + [Fact] + public Task LargeUnary() => InteropTestCase("large_unary"); + + [Fact] + public Task ClientStreaming() => InteropTestCase("client_streaming"); + + [Fact] + public Task ServerStreaming() => InteropTestCase("server_streaming"); + + [Fact] + [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/22101")] + public Task PingPong() => InteropTestCase("ping_pong"); + + [Fact] + public Task EmptyStream() => InteropTestCase("empty_stream"); + + [Fact] + public Task CancelAfterBegin() => InteropTestCase("cancel_after_begin"); + + [Fact] + public Task CancelAfterFirstResponse() => InteropTestCase("cancel_after_first_response"); + + [Fact] + public Task TimeoutOnSleepingServer() => InteropTestCase("timeout_on_sleeping_server"); + + [Fact] + public Task CustomMetadata() => InteropTestCase("custom_metadata"); + + [Fact] + public Task StatusCodeAndMessage() => InteropTestCase("status_code_and_message"); + + [Fact] + public Task SpecialStatusMessage() => InteropTestCase("special_status_message"); + + [Fact] + public Task UnimplementedService() => InteropTestCase("unimplemented_service"); + + [Fact] + public Task UnimplementedMethod() => InteropTestCase("unimplemented_method"); + + [Fact] + public Task ClientCompressedUnary() => InteropTestCase("client_compressed_unary"); + + [Fact] + public Task ClientCompressedStreaming() => InteropTestCase("client_compressed_streaming"); + + [Fact] + public Task ServerCompressedUnary() => InteropTestCase("server_compressed_unary"); + + [Fact] + public Task ServerCompressedStreaming() => InteropTestCase("server_compressed_streaming"); + + private async Task InteropTestCase(string name) { using (var serverProcess = new WebsiteProcess(_serverPath, _output)) {