Skip to content

Commit 3132e5c

Browse files
authored
Support quarantine on individual gRPC interop tests (#22124)
1 parent b37ebf5 commit 3132e5c

File tree

1 file changed

+57
-31
lines changed

1 file changed

+57
-31
lines changed

src/Grpc/test/InteropTests/InteropTests.cs

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
namespace InteropTests
1515
{
16+
// All interop test cases, minus GCE authentication specific tests.
17+
// Tests are separate methods so that they can be quarantined separately.
1618
public class InteropTests
1719
{
1820
private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(30);
@@ -25,10 +27,62 @@ public InteropTests(ITestOutputHelper output)
2527
_output = output;
2628
}
2729

28-
[Theory]
30+
[Fact]
31+
public Task EmptyUnary() => InteropTestCase("empty_unary");
32+
33+
[Fact]
34+
public Task LargeUnary() => InteropTestCase("large_unary");
35+
36+
[Fact]
37+
public Task ClientStreaming() => InteropTestCase("client_streaming");
38+
39+
[Fact]
40+
public Task ServerStreaming() => InteropTestCase("server_streaming");
41+
42+
[Fact]
2943
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/22101")]
30-
[MemberData(nameof(TestCaseData))]
31-
public async Task InteropTestCase(string name)
44+
public Task PingPong() => InteropTestCase("ping_pong");
45+
46+
[Fact]
47+
public Task EmptyStream() => InteropTestCase("empty_stream");
48+
49+
[Fact]
50+
public Task CancelAfterBegin() => InteropTestCase("cancel_after_begin");
51+
52+
[Fact]
53+
public Task CancelAfterFirstResponse() => InteropTestCase("cancel_after_first_response");
54+
55+
[Fact]
56+
public Task TimeoutOnSleepingServer() => InteropTestCase("timeout_on_sleeping_server");
57+
58+
[Fact]
59+
public Task CustomMetadata() => InteropTestCase("custom_metadata");
60+
61+
[Fact]
62+
public Task StatusCodeAndMessage() => InteropTestCase("status_code_and_message");
63+
64+
[Fact]
65+
public Task SpecialStatusMessage() => InteropTestCase("special_status_message");
66+
67+
[Fact]
68+
public Task UnimplementedService() => InteropTestCase("unimplemented_service");
69+
70+
[Fact]
71+
public Task UnimplementedMethod() => InteropTestCase("unimplemented_method");
72+
73+
[Fact]
74+
public Task ClientCompressedUnary() => InteropTestCase("client_compressed_unary");
75+
76+
[Fact]
77+
public Task ClientCompressedStreaming() => InteropTestCase("client_compressed_streaming");
78+
79+
[Fact]
80+
public Task ServerCompressedUnary() => InteropTestCase("server_compressed_unary");
81+
82+
[Fact]
83+
public Task ServerCompressedStreaming() => InteropTestCase("server_compressed_streaming");
84+
85+
private async Task InteropTestCase(string name)
3286
{
3387
using (var serverProcess = new WebsiteProcess(_serverPath, _output))
3488
{
@@ -44,33 +98,5 @@ public async Task InteropTestCase(string name)
4498
}
4599
}
46100
}
47-
48-
#region TestData
49-
// All interop test cases, minus GCE authentication specific tests
50-
private static string[] AllTests = new string[]
51-
{
52-
"empty_unary",
53-
"large_unary",
54-
"client_streaming",
55-
"server_streaming",
56-
"ping_pong",
57-
"empty_stream",
58-
59-
"cancel_after_begin",
60-
"cancel_after_first_response",
61-
"timeout_on_sleeping_server",
62-
"custom_metadata",
63-
"status_code_and_message",
64-
"special_status_message",
65-
"unimplemented_service",
66-
"unimplemented_method",
67-
"client_compressed_unary",
68-
"client_compressed_streaming",
69-
"server_compressed_unary",
70-
"server_compressed_streaming"
71-
};
72-
73-
public static IEnumerable<object[]> TestCaseData => AllTests.Select(t => new object[] { t });
74-
#endregion
75101
}
76102
}

0 commit comments

Comments
 (0)