Skip to content

Commit

Permalink
[wasm] Enable more networking tests (dotnet#53027)
Browse files Browse the repository at this point in the history
- enable System.Net.Http.Functional.Tests on browser
- System.Net.Http.Functional.Tests to run in chrome instead of V8 via WasmTestOnBrowser
- ActiveIssue dotnet#34690 for WebSocket on Windows Mono
- fix Quic detection in test
- disable webSocket tests on Mono/Windows
- disable tests with MaxConnectionsPerServer not supported on Browser
- disable tests with Socket not supported on Browser
- disable tests with AutomaticDecompression not supported on Browser
- disable tests with UseProxy not supported on Browser
- disable tests with PreAuthenticate not supported on Browser
- disable tests with Credentials is not supported on Browser
- disable tests with Loopback server
- run outerloop on browser, rather than V8 only
- [ActiveIssue] dotnet#37669 for missing crypto MD5
- conditional tests with PlatformDetection.IsBrowserDomSupportedOrNotBrowser to allow System.Net.Http.Functional.Tests pass on V8
- disabled tests with dotnet#53018
- disabled tests with dotnet#53591
- disabled tests with dotnet#53592
  • Loading branch information
pavelsavara authored Jun 2, 2021
1 parent e68d2a3 commit 1e19518
Show file tree
Hide file tree
Showing 31 changed files with 267 additions and 123 deletions.
2 changes: 2 additions & 0 deletions eng/pipelines/libraries/outerloop-mono.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
scenarios:
- wasmtestonbrowser
testScope: outerloop
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class DefaultCredentialsTest : HttpClientHandlerTestBase

public DefaultCredentialsTest(ITestOutputHelper output) : base(output) { }

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(nameof(ServerAuthenticationTestsEnabled))]
[MemberData(nameof(AuthenticatedServers))]
public async Task UseDefaultCredentials_DefaultValue_Unauthorized(string uri, bool useProxy)
Expand All @@ -55,7 +55,7 @@ public async Task UseDefaultCredentials_DefaultValue_Unauthorized(string uri, bo
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(nameof(ServerAuthenticationTestsEnabled))]
[MemberData(nameof(AuthenticatedServers))]
public async Task UseDefaultCredentials_SetFalse_Unauthorized(string uri, bool useProxy)
Expand All @@ -71,7 +71,7 @@ public async Task UseDefaultCredentials_SetFalse_Unauthorized(string uri, bool u
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(nameof(ServerAuthenticationTestsEnabled))]
[MemberData(nameof(AuthenticatedServers))]
public async Task UseDefaultCredentials_SetTrue_ConnectAsCurrentIdentity(string uri, bool useProxy)
Expand All @@ -92,7 +92,7 @@ public async Task UseDefaultCredentials_SetTrue_ConnectAsCurrentIdentity(string
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(nameof(ServerAuthenticationTestsEnabled))]
[MemberData(nameof(AuthenticatedServers))]
public async Task Credentials_SetToWrappedDefaultCredential_ConnectAsCurrentIdentity(string uri, bool useProxy)
Expand All @@ -116,7 +116,7 @@ public async Task Credentials_SetToWrappedDefaultCredential_ConnectAsCurrentIden
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(nameof(ServerAuthenticationTestsEnabled))]
[MemberData(nameof(AuthenticatedServers))]
public async Task Credentials_SetToBadCredential_Unauthorized(string uri, bool useProxy)
Expand All @@ -132,7 +132,7 @@ public async Task Credentials_SetToBadCredential_Unauthorized(string uri, bool u
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/17845")]
[ConditionalTheory(nameof(DomainJoinedTestsEnabled))]
[InlineData(false)]
Expand All @@ -154,7 +154,7 @@ public async Task Credentials_SetToSpecificCredential_ConnectAsSpecificIdentity(
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/17845")]
[ConditionalFact(nameof(DomainProxyTestsEnabled))]
public async Task Proxy_UseAuthenticatedProxyWithNoCredentials_ProxyAuthenticationRequired()
Expand All @@ -169,7 +169,7 @@ public async Task Proxy_UseAuthenticatedProxyWithNoCredentials_ProxyAuthenticati
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/17845")]
[ConditionalFact(nameof(DomainProxyTestsEnabled))]
public async Task Proxy_UseAuthenticatedProxyWithDefaultCredentials_OK()
Expand All @@ -184,7 +184,7 @@ public async Task Proxy_UseAuthenticatedProxyWithDefaultCredentials_OK()
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalFact(nameof(DomainProxyTestsEnabled))]
public async Task Proxy_UseAuthenticatedProxyWithWrappedDefaultCredentials_OK()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static IEnumerable<object[]> RedirectStatusCodesOldMethodsNewMethods()
}
public HttpClientHandlerTest_AutoRedirect(ITestOutputHelper output) : base(output) { }

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersAndRedirectStatusCodes))]
public async Task GetAsync_AllowAutoRedirectFalse_RedirectFromHttpToHttp_StatusCodeRedirect(Configuration.Http.RemoteServer remoteServer, int statusCode)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ await LoopbackServer.CreateServerAsync(async (redirServer, redirUrl) =>
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersAndRedirectStatusCodes))]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttp_StatusCodeOK(Configuration.Http.RemoteServer remoteServer, int statusCode)
{
Expand All @@ -219,7 +219,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttp_StatusCo
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Fact]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttps_StatusCodeOK()
{
Expand All @@ -240,7 +240,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttps_StatusC
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Fact]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpsToHttp_StatusCodeRedirect()
{
Expand Down Expand Up @@ -288,7 +288,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectToUriWithParams_RequestMsgUriSet(Configuration.Http.RemoteServer remoteServer)
{
Expand All @@ -310,7 +310,7 @@ public async Task GetAsync_AllowAutoRedirectTrue_RedirectToUriWithParams_Request
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory]
[InlineData(3, 2)]
[InlineData(3, 3)]
Expand Down Expand Up @@ -358,7 +358,7 @@ public async Task GetAsync_MaxAutomaticRedirectionsNServerHops_ThrowsIfTooMany(i
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersMemberData))]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectWithRelativeLocation(Configuration.Http.RemoteServer remoteServer)
{
Expand Down Expand Up @@ -478,7 +478,7 @@ await LoopbackServer.CreateServerAsync(async (origServer, origUrl) =>
}

[Theory, MemberData(nameof(RemoteServersMemberData))]
[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
public async Task GetAsync_CredentialIsNetworkCredentialUriRedirect_StatusCodeUnauthorized(Configuration.Http.RemoteServer remoteServer)
{
HttpClientHandler handler = CreateHttpClientHandler();
Expand All @@ -497,7 +497,7 @@ public async Task GetAsync_CredentialIsNetworkCredentialUriRedirect_StatusCodeUn
}

[Theory, MemberData(nameof(RemoteServersMemberData))]
[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
public async Task HttpClientHandler_CredentialIsNotCredentialCacheAfterRedirect_StatusCodeOK(Configuration.Http.RemoteServer remoteServer)
{
HttpClientHandler handler = CreateHttpClientHandler();
Expand All @@ -522,7 +522,7 @@ public async Task HttpClientHandler_CredentialIsNotCredentialCacheAfterRedirect_
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersAndRedirectStatusCodes))]
public async Task GetAsync_CredentialIsCredentialCacheUriRedirect_StatusCodeOK(Configuration.Http.RemoteServer remoteServer, int statusCode)
{
Expand Down Expand Up @@ -554,7 +554,7 @@ public async Task GetAsync_CredentialIsCredentialCacheUriRedirect_StatusCodeOK(C
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersAndRedirectStatusCodes))]
public async Task DefaultHeaders_SetCredentials_ClearedOnRedirect(Configuration.Http.RemoteServer remoteServer, int statusCode)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ await server.AcceptConnectionAsync(async connection =>
}

[OuterLoop("Uses external servers")]
[SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")]
[Theory, MemberData(nameof(RemoteServersAndCompressionUris))]
public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_GZip(Configuration.Http.RemoteServer remoteServer, Uri uri)
{
Expand Down Expand Up @@ -205,6 +206,7 @@ public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_GZip(Co
[Theory]
[InlineData("http://httpbin.org/deflate", "\"deflated\": true")]
[InlineData("https://httpbin.org/deflate", "\"deflated\": true")]
[SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")]
public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_Deflate(string uri, string expectedContent)
{
if (IsWinHttpHandler)
Expand All @@ -221,8 +223,9 @@ public async Task GetAsync_SetAutomaticDecompression_ContentDecompressed_Deflate
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory, MemberData(nameof(RemoteServersAndCompressionUris))]
[SkipOnPlatform(TestPlatforms.Browser, "AutomaticDecompression not supported on Browser")]
public async Task GetAsync_SetAutomaticDecompression_HeadersRemoved(Configuration.Http.RemoteServer remoteServer, Uri uri)
{
// Sync API supported only up to HTTP/1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ await LoopbackServer.CreateClientAndServerAsync(uri => Task.Run(() =>
// The purpose of this test is mainly to validate the .NET Framework OOB System.Net.Http implementation
// since it has an underlying dependency to WebRequest. While .NET Core implementations of System.Net.Http
// are not using any WebRequest code, the test is still useful to validate correctness.
[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Fact]
public async Task ProxyNotExplicitlyProvided_DefaultCredentialsSet_DefaultWebProxySetToNull_Success()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/1507")]
[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))]
[InlineData(AuthenticationSchemes.Ntlm, true, false)]
[InlineData(AuthenticationSchemes.Negotiate, true, false)]
Expand Down Expand Up @@ -114,7 +114,7 @@ await response.Content.ReadAsStringAsync(),

public static bool IsSocketsHttpHandlerAndRemoteExecutorSupported => !HttpClientHandlerTestBase.IsWinHttpHandler && RemoteExecutor.IsSupported;

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[ConditionalFact(nameof(IsSocketsHttpHandlerAndRemoteExecutorSupported))]
public void Proxy_UseEnvironmentVariableToSetSystemProxy_RequestGoesThruProxy()
{
Expand Down Expand Up @@ -171,7 +171,7 @@ private void ValidateProxyBasicAuthentication(LoopbackProxyServer proxyServer, N
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory]
[MemberData(nameof(CredentialsForProxy))]
public async Task AuthenticatedProxiedRequest_GetAsyncWithCreds_Success(NetworkCredential cred, bool wrapCredsInCache, bool connectionCloseAfter407)
Expand Down Expand Up @@ -202,7 +202,7 @@ await response.Content.ReadAsStringAsync(),
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory]
[MemberData(nameof(CredentialsForProxy))]
public async Task AuthenticatedProxyTunnelRequest_PostAsyncWithCreds_Success(NetworkCredential cred, bool wrapCredsInCache, bool connectionCloseAfter407)
Expand Down Expand Up @@ -241,7 +241,7 @@ public async Task AuthenticatedProxyTunnelRequest_PostAsyncWithCreds_Success(Net
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Theory]
[MemberData(nameof(BypassedProxies))]
public async Task Proxy_BypassTrue_GetRequestDoesntGoesThroughCustomProxy(IWebProxy proxy)
Expand All @@ -259,7 +259,7 @@ await response.Content.ReadAsStringAsync(),
}
}

[OuterLoop("Uses external server")]
[OuterLoop("Uses external servers")]
[Fact]
public async Task AuthenticatedProxiedRequest_GetAsyncWithNoCreds_ProxyAuthenticationRequiredStatusCode()
{
Expand Down
Loading

0 comments on commit 1e19518

Please sign in to comment.