Skip to content

Commit

Permalink
[browser][tests] Standup System.Net.WebSockets.Client.Tests in CI (#4…
Browse files Browse the repository at this point in the history
…4781)

* [browser][tests] Standup System.Net.WebSockets.Client.Tests in CI

* Just a small test to see if tests are actually kicked off and failing.

* Remove comment from ActiveIssue to pass tests

* Address review comments

- mark the loopback issues as activeIssue - [ActiveIssue("#34690", TestPlatforms.Browser)]

* Address review comments

* Correct confusion I caused

* Remove extra extra exclusion that snuck in

* Make browser specific failure browser specific

Co-authored-by: Larry Ewing <[email protected]>
  • Loading branch information
kjpou1 and lewing authored Nov 21, 2020
1 parent 99e9cbc commit 0a14898
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ClientWebSocketOptionsTests : ClientWebSocketTestBase
public ClientWebSocketOptionsTests(ITestOutputHelper output) : base(output) { }

[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public static void UseDefaultCredentials_Roundtrips()
{
var cws = new ClientWebSocket();
Expand All @@ -28,6 +29,7 @@ public static void UseDefaultCredentials_Roundtrips()
}

[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // Proxy not supported on browser
public static void Proxy_Roundtrips()
{
var cws = new ClientWebSocket();
Expand Down Expand Up @@ -99,6 +101,7 @@ public async Task Proxy_ConnectThruProxy_Success(Uri server)
}

[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // Buffer not supported on browser
public static void SetBuffer_InvalidArgs_Throws()
{
// Recreate the minimum WebSocket buffer size values from the .NET Framework version of WebSocket,
Expand All @@ -120,6 +123,7 @@ public static void SetBuffer_InvalidArgs_Throws()
}

[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // KeepAlive not supported on browser
public static void KeepAliveInterval_Roundtrips()
{
var cws = new ClientWebSocket();
Expand All @@ -138,6 +142,7 @@ public static void KeepAliveInterval_Roundtrips()
}

[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // Certificates not supported on browser
public void RemoteCertificateValidationCallback_Roundtrips()
{
using (var cws = new ClientWebSocket())
Expand All @@ -157,6 +162,7 @@ public void RemoteCertificateValidationCallback_Roundtrips()
[ConditionalTheory(nameof(WebSocketsSupported))]
[InlineData(false)]
[InlineData(true)]
[PlatformSpecific(~TestPlatforms.Browser)] // Certificates not supported on browser
public async Task RemoteCertificateValidationCallback_PassedRemoteCertificateInfo(bool secure)
{
if (PlatformDetection.IsWindows7)
Expand Down Expand Up @@ -193,6 +199,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>

[OuterLoop("Connects to remote service")]
[ConditionalFact(nameof(WebSocketsSupported))]
[PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public async Task ClientCertificates_ValidCertificate_ServerReceivesCertificateAndConnectAsyncSucceeds()
{
if (PlatformDetection.IsWindows7)
Expand Down Expand Up @@ -230,6 +237,7 @@ await LoopbackServer.CreateClientAndServerAsync(async uri =>
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[InlineData("ws://")]
[InlineData("wss://")]
[PlatformSpecific(~TestPlatforms.Browser)] // Credentials not supported on browser
public async Task NonSecureConnect_ConnectThruProxy_CONNECTisUsed(string connectionType)
{
if (PlatformDetection.IsWindows7)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ public async Task CloseAsync_DuringConcurrentReceiveAsync_ExpectedStates(Uri ser

[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task CloseAsync_CancelableEvenWhenPendingReceive_Throws()
{
var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public async Task ConnectAsync_AddCustomHeaders_Success(Uri server)

[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_AddHostHeader_Success()
{
string expectedHost = null;
Expand Down Expand Up @@ -208,6 +209,7 @@ public async Task ConnectAsync_PassMultipleSubProtocols_ServerRequires_Connectio

[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_NonStandardRequestHeaders_HeadersAddedWithoutValidation()
{
await LoopbackServer.CreateClientAndServerAsync(async uri =>
Expand Down Expand Up @@ -246,6 +248,7 @@ public async Task ConnectAndCloseAsync_UseProxyServer_ExpectedClosedState(Uri se
}

[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/44720", TestPlatforms.Browser)]
public async Task ConnectAsync_CancellationRequestedBeforeConnect_ThrowsOperationCanceledException()
{
using (var clientSocket = new ClientWebSocket())
Expand All @@ -259,6 +262,7 @@ public async Task ConnectAsync_CancellationRequestedBeforeConnect_ThrowsOperatio

[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task ConnectAsync_CancellationRequestedAfterConnect_ThrowsOperationCanceledException()
{
var releaseServer = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ public async Task SendReceive_Concurrent_Success(Uri server)

[OuterLoop("Uses external servers")]
[ConditionalFact(nameof(WebSocketsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/42852", TestPlatforms.Browser)]
public async Task SendReceive_ConnectionClosedPrematurely_ReceiveAsyncFailsAndWebSocketStateUpdated()
{
var options = new LoopbackServer.Options { WebSocketEndpoint = true };
Expand Down
1 change: 0 additions & 1 deletion src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@

<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Parallel\tests\System.Linq.Parallel.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 0a14898

Please sign in to comment.