Support quarantine on individual gRPC interop tests (#22124)

This commit is contained in:
James Newton-King 2020-05-22 15:47:32 +12:00 committed by GitHub
parent b37ebf51e3
commit 3132e5c6ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 57 additions and 31 deletions

View File

@ -13,6 +13,8 @@ using Xunit.Abstractions;
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,10 +27,62 @@ namespace InteropTests
_output = output;
}
[Theory]
[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")]
[MemberData(nameof(TestCaseData))]
public async Task InteropTestCase(string name)
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))
{
@ -44,33 +98,5 @@ namespace InteropTests
}
}
}
#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<object[]> TestCaseData => AllTests.Select(t => new object[] { t });
#endregion
}
}