[browser][tests] Standup System.Net.WebSockets.Client.Tests in CI (#44781)
authorKenneth Pouncey <kjpou@pt.lu>
Sat, 21 Nov 2020 02:45:12 +0000 (03:45 +0100)
committerGitHub <noreply@github.com>
Sat, 21 Nov 2020 02:45:12 +0000 (20:45 -0600)
* [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("https://github.com/dotnet/runtime/issues/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 <lewing@microsoft.com>
src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketOptionsTests.cs
src/libraries/System.Net.WebSockets.Client/tests/CloseTest.cs
src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs
src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs
src/libraries/tests.proj

index 8065bc3..a11c4aa 100644 (file)
@@ -17,6 +17,7 @@ namespace System.Net.WebSockets.Client.Tests
         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();
@@ -28,6 +29,7 @@ namespace System.Net.WebSockets.Client.Tests
         }
 
         [ConditionalFact(nameof(WebSocketsSupported))]
+        [PlatformSpecific(~TestPlatforms.Browser)] // Proxy not supported on browser
         public static void Proxy_Roundtrips()
         {
             var cws = new ClientWebSocket();
@@ -99,6 +101,7 @@ namespace System.Net.WebSockets.Client.Tests
         }
 
         [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,
@@ -120,6 +123,7 @@ namespace System.Net.WebSockets.Client.Tests
         }
 
         [ConditionalFact(nameof(WebSocketsSupported))]
+        [PlatformSpecific(~TestPlatforms.Browser)] // KeepAlive not supported on browser
         public static void KeepAliveInterval_Roundtrips()
         {
             var cws = new ClientWebSocket();
@@ -138,6 +142,7 @@ namespace System.Net.WebSockets.Client.Tests
         }
 
         [ConditionalFact(nameof(WebSocketsSupported))]
+        [PlatformSpecific(~TestPlatforms.Browser)] // Certificates not supported on browser
         public void RemoteCertificateValidationCallback_Roundtrips()
         {
             using (var cws = new ClientWebSocket())
@@ -157,6 +162,7 @@ namespace System.Net.WebSockets.Client.Tests
         [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)
@@ -193,6 +199,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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)
@@ -230,6 +237,7 @@ namespace System.Net.WebSockets.Client.Tests
         [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)
index 7bdffd2..a803d4c 100644 (file)
@@ -327,6 +327,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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);
index 265db6d..45c94e4 100644 (file)
@@ -89,6 +89,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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;
@@ -208,6 +209,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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 =>
@@ -246,6 +248,7 @@ namespace System.Net.WebSockets.Client.Tests
         }
 
         [ConditionalFact(nameof(WebSocketsSupported))]
+        [ActiveIssue("https://github.com/dotnet/runtime/issues/44720", TestPlatforms.Browser)]
         public async Task ConnectAsync_CancellationRequestedBeforeConnect_ThrowsOperationCanceledException()
         {
             using (var clientSocket = new ClientWebSocket())
@@ -259,6 +262,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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);
index 163fc2b..5bfc2c9 100644 (file)
@@ -389,6 +389,7 @@ namespace System.Net.WebSockets.Client.Tests
 
         [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 };
index 511f7f6..7a57738 100644 (file)
 
     <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>