Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.test.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,9 @@ dotnet_diagnostic.xUnit1030.severity = none
# xUnit1031: Test methods must not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead.
dotnet_diagnostic.xUnit1031.severity = none

# xUnit1051: Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive.
dotnet_diagnostic.xUnit1051.severity = none

# xUnit2000: Constants and literals should be the expected argument
dotnet_diagnostic.xUnit2000.severity = warning

Expand Down
2 changes: 1 addition & 1 deletion eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d27184f7cb92b4abb4b20e91ecb5c43bc43de65b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="10.0.0-beta.25408.3">
<Dependency Name="Microsoft.DotNet.XUnitV3Extensions" Version="10.0.0-beta.25408.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d27184f7cb92b4abb4b20e91ecb5c43bc43de65b</Sha>
</Dependency>
Expand Down
3 changes: 2 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<SystemIOHashingVersion>8.0.0</SystemIOHashingVersion>
<MicrosoftAspNetCoreTestHostVersion>6.0.36</MicrosoftAspNetCoreTestHostVersion>
<MicrosoftCrankEventSourcesVersion>0.2.0-alpha.24576.2</MicrosoftCrankEventSourcesVersion>
<MicrosoftDotNetXUnitExtensionsPackageVersion>10.0.0-beta.25408.3</MicrosoftDotNetXUnitExtensionsPackageVersion>
<MicrosoftDotNetXUnitV3ExtensionsPackageVersion>10.0.0-beta.25408.3</MicrosoftDotNetXUnitV3ExtensionsPackageVersion>
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
<MoqVersion>4.18.4</MoqVersion>
<AutofacVersion>4.9.4</AutofacVersion>
Expand All @@ -29,6 +29,7 @@
<YamlDotNetVersion>16.2.1</YamlDotNetVersion>
<KubernetesClientVersion>15.0.1</KubernetesClientVersion>
<JsonSchemaNetVersion>7.0.2</JsonSchemaNetVersion>
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<!-- Container app dependencies -->
<YarpNugetVersion>2.3.0</YarpNugetVersion>
<MicrosoftExtensionsServiceDiscovery>9.1.0</MicrosoftExtensionsServiceDiscovery>
Expand Down
3 changes: 3 additions & 0 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@

<PropertyGroup>
<IsTestProject>true</IsTestProject>
<TestRunnerName>XUnitV3</TestRunnerName>

<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion test/Kubernetes.Tests/IngressCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.Extensions.Options;
using Moq;
using Xunit;
using Xunit.Abstractions;
using Yarp.Kubernetes.Controller;
using Yarp.Kubernetes.Controller.Caching;
using Yarp.Kubernetes.Controller.Certificates;
Expand Down
1 change: 0 additions & 1 deletion test/Kubernetes.Tests/IngressControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Yarp.Kubernetes.Controller;
using Yarp.Kubernetes.Controller.Caching;
using Yarp.Kubernetes.Controller.Client.Tests;
Expand Down
1 change: 0 additions & 1 deletion test/Kubernetes.Tests/ReconcilerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Yarp.Kubernetes.Controller;
using Yarp.Kubernetes.Controller.Client;
using Yarp.Kubernetes.Controller.Caching;
Expand Down
2 changes: 1 addition & 1 deletion test/Kubernetes.Tests/Utils/TestLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;
using Xunit;

namespace Yarp.Kubernetes.Tests.Utils;

Expand Down
3 changes: 2 additions & 1 deletion test/Kubernetes.Tests/Yarp.Kubernetes.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>$(TestTFMs)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);CS8002</NoWarn>
<RootNamespace>Yarp.Kubernetes</RootNamespace>
</PropertyGroup>
Expand All @@ -15,6 +15,7 @@
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="Polly" Version="$(PollyVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
using Yarp.ReverseProxy.Configuration;
using Yarp.Tests.Common;

Expand Down
6 changes: 3 additions & 3 deletions test/ReverseProxy.FunctionalTests/Expect100ContinueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Expect100ContinueTests
// See https://github.com/dotnet/runtime/issues/27727
public static bool Http2OverTlsSupported => !RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

[ConditionalTheory(nameof(Http2OverTlsSupported))]
[Theory(Skip = "Condition not met", SkipUnless = nameof(Http2OverTlsSupported))]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http1, true, 200)]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http1, false, 200)]
[InlineData(HttpProtocols.Http2, HttpProtocols.Http2, true, 200)]
Expand Down Expand Up @@ -109,7 +109,7 @@ await test.Invoke(async uri =>
});
}

[ConditionalTheory(nameof(Http2OverTlsSupported))]
[Theory(Skip = "Condition not met", SkipUnless = nameof(Http2OverTlsSupported))]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http1, true, true, 200)]
[InlineData(HttpProtocols.Http2, HttpProtocols.Http2, true, true, 200)]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http2, true, true, 200)]
Expand Down Expand Up @@ -186,7 +186,7 @@ await ProcessHttpRequest(new Uri(uri), proxyProtocol, contentString, useContentL
});
}

[ConditionalTheory(nameof(Http2OverTlsSupported))]
[Theory(Skip = "Condition not met", SkipUnless = nameof(Http2OverTlsSupported))]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http1, false)]
[InlineData(HttpProtocols.Http2, HttpProtocols.Http2, false)]
[InlineData(HttpProtocols.Http1, HttpProtocols.Http2, false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class HttpForwarderCancellationTests
// See https://github.com/dotnet/runtime/issues/27727
public static bool Http2OverTlsSupported => !RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

[ConditionalFact(nameof(Http2OverTlsSupported))]
[Fact(Skip = "Condition not met", SkipUnless = nameof(Http2OverTlsSupported))]
public async Task ServerSendsHttp2Reset_ReadToClientIsCanceled()
{
var readAsyncCalled = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -102,7 +103,8 @@ await test.Invoke(async proxyUri =>

private class HttpSysDelegationFactAttribute : FactAttribute
{
public HttpSysDelegationFactAttribute()
public HttpSysDelegationFactAttribute([CallerFilePath] string sourceFilePath = null, [CallerLineNumber] int sourceLineNumber = -1)
: base(sourceFilePath, sourceLineNumber)
{
// Htty.sys delegation was added to Windows in the 21H2 release but back ported through RS5 (1809)
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 1809))
Expand Down
1 change: 0 additions & 1 deletion test/ReverseProxy.FunctionalTests/WebSocketTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers;
using Xunit;
using Xunit.Abstractions;
using Yarp.ReverseProxy.Common;
using Yarp.ReverseProxy.Forwarder;
using Yarp.ReverseProxy.Transforms;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;
using Yarp.ReverseProxy.Common;
using Yarp.Telemetry.Consumption;
using Yarp.Tests.Common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(TestTFMs)</TargetFrameworks>
<NoWarn>$(NoWarn);SYSLIB0057</NoWarn>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.ReverseProxy</RootNamespace>

<!--
Expand All @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsPackageVersion)" />
<PackageReference Include="Microsoft.DotNet.XUnitV3Extensions" Version="$(MicrosoftDotNetXUnitV3ExtensionsPackageVersion)" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion test/ReverseProxy.Tests/Forwarder/HttpForwarderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using Microsoft.Net.Http.Headers;
using Moq;
using Xunit;
using Xunit.Abstractions;
using Yarp.ReverseProxy.Common;
using Yarp.ReverseProxy.Transforms;
using Yarp.ReverseProxy.Transforms.Builder.Tests;
Expand Down
2 changes: 1 addition & 1 deletion test/ReverseProxy.Tests/Yarp.ReverseProxy.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>$(TestTFMs)</TargetFrameworks>
<OutputType>Library</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.ReverseProxy</RootNamespace>
<NoWarn>$(NoWarn);SYSLIB0039;SYSLIB0057</NoWarn>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Tests.Common/TestLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Testing;
using Xunit.Abstractions;
using Xunit;

namespace Yarp.ReverseProxy.Common;

Expand Down
4 changes: 2 additions & 2 deletions test/Tests.Common/XunitLoggerFactoryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Testing;
using Xunit.Abstractions;
using Xunit;

namespace Microsoft.Extensions.Logging;

Expand Down
2 changes: 1 addition & 1 deletion test/Tests.Common/XunitLoggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq;
using System.Text;
using System.Threading;
using Xunit.Abstractions;
using Xunit;

namespace Microsoft.Extensions.Logging.Testing;

Expand Down
5 changes: 5 additions & 0 deletions test/Tests.Common/Yarp.Tests.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
<TargetFrameworks>$(TestTFMs)</TargetFrameworks>
<OutputType>Library</OutputType>
<RootNamespace>Yarp.Common.Tests</RootNamespace>
<!-- This is a test utility project. -->
<IsTestProject>false</IsTestProject>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="$(AutofacVersion)" />
<PackageReference Include="Autofac.Extras.Moq" Version="$(AutofacExtrasMoqVersion)" />
<PackageReference Include="coverlet.collector" Version="$(CoverletCollectorVersion)" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<PackageReference Include="xunit.v3.extensibility.core" Version="$(XUnitV3Version)" />
<PackageReference Include="xunit.v3.assert" Version="$(XUnitV3Version)" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading