Skip to content

Commit e23f16e

Browse files
committed
Update to Xunit 2.4.1
1 parent e857ee8 commit e23f16e

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

examples/Elastic.Xunit.ExampleComplex/Elastic.Xunit.ExampleComplex.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net5.0;net461</TargetFrameworks>
44
<IsPackable>False</IsPackable>
55
</PropertyGroup>
66
<ItemGroup>
77
<ProjectReference Include="..\..\src\Elastic.Elasticsearch.Ephemeral\Elastic.Elasticsearch.Ephemeral.csproj" />
8-
<PackageReference Include="xunit" Version="2.3.1" />
9-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
8+
<PackageReference Include="xunit" Version="2.4.1" />
9+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
</PackageReference>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1114

1215
<PackageReference Include="NEST" Version="6.0.1" />
1316
<PackageReference Include="FluentAssertions" Version="5.1.2" />

examples/Elastic.Xunit.ExampleMinimal/Elastic.Xunit.ExampleMinimal.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net5.0;net461</TargetFrameworks>
44
<IsPackable>False</IsPackable>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="xunit" Version="2.3.1" />
8-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
10-
7+
<PackageReference Include="xunit" Version="2.4.1" />
8+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
9+
<PrivateAssets>all</PrivateAssets>
10+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11+
</PackageReference>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
1113
<PackageReference Include="NEST" Version="6.0.1" />
1214
<PackageReference Include="FluentAssertions" Version="5.1.2" />
1315
</ItemGroup>

src/Elastic.Elasticsearch.Xunit/Elastic.Elasticsearch.Xunit.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
3+
<TargetFrameworks>netstandard2.0;netstandard2.1;net461</TargetFrameworks>
44
<IsPackable>True</IsPackable>
55
<Description>Provides an Xunit test framework allowing you to run integration tests against local ephemeral Elasticsearch clusters</Description>
66
<PackageTags>elastic,elasticsearch,xunit,cluster,integration,test,ephemeral</PackageTags>
77
</PropertyGroup>
88
<ItemGroup>
9-
<PackageReference Include="xunit" Version="2.3.1" />
9+
<PackageReference Include="xunit" Version="2.4.1" />
1010
</ItemGroup>
1111
<ItemGroup>
1212
<ProjectReference Include="..\Elastic.Elasticsearch.Ephemeral\Elastic.Elasticsearch.Ephemeral.csproj" />

src/Elastic.Elasticsearch.Xunit/XunitPlumbing/ElasticTestCaseDiscoverer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions disco
3030
: new IXunitTestCase[] {new SkippingTestCase(skipReason, testMethod, null)}
3131
: new[]
3232
{
33-
new XunitTestCase(DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod)
33+
new XunitTestCase(DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), TestMethodDisplayOptions.None, testMethod)
3434
};
3535

3636
/// <summary>

src/Elastic.Elasticsearch.Xunit/XunitPlumbing/IntegrationTestDiscoverer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ protected override bool SkipMethod(ITestFrameworkDiscoveryOptions discoveryOptio
7575
if (skipVersionAttribute != null)
7676
{
7777
var skipVersionRanges =
78-
skipVersionAttribute.GetNamedArgument<IList<Range>>(nameof(SkipVersionAttribute.Ranges)) ??
79-
new List<Range>();
78+
skipVersionAttribute.GetNamedArgument<IList<SemVer.Range>>(nameof(SkipVersionAttribute.Ranges)) ??
79+
new List<SemVer.Range>();
8080
if (elasticsearchVersion == null && skipVersionRanges.Count > 0)
8181
{
8282
skipReason = $"{nameof(SkipVersionAttribute)} has ranges defined for this test but " +

src/Elastic.Elasticsearch.Xunit/XunitPlumbing/SkipVersionAttribute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public SkipVersionAttribute(string skipVersionRangesSeparatedByComma, string rea
2020
{
2121
Reason = reason;
2222
Ranges = string.IsNullOrEmpty(skipVersionRangesSeparatedByComma)
23-
? new List<Range>()
23+
? new List<SemVer.Range>()
2424
: skipVersionRangesSeparatedByComma.Split(',')
2525
.Select(r => r.Trim())
2626
.Where(r => !string.IsNullOrWhiteSpace(r))
27-
.Select(r => new Range(r))
27+
.Select(r => new SemVer.Range(r))
2828
.ToList();
2929
}
3030

@@ -36,6 +36,6 @@ public SkipVersionAttribute(string skipVersionRangesSeparatedByComma, string rea
3636
/// <summary>
3737
/// The version ranges for which the test should be skipped
3838
/// </summary>
39-
public IList<Range> Ranges { get; }
39+
public IList<SemVer.Range> Ranges { get; }
4040
}
4141
}

src/Elastic.Elasticsearch.Xunit/XunitPlumbing/SkippingTestCase.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ public SkippingTestCase()
2222
/// <param name="testMethod">The test method this test case belongs to.</param>
2323
/// <param name="testMethodArguments">The arguments for the test method.</param>
2424
public SkippingTestCase(string skipReason, ITestMethod testMethod, object[] testMethodArguments = null)
25-
: base(TestMethodDisplay.ClassAndMethod, testMethod, testMethodArguments) =>
25+
: base(TestMethodDisplay.ClassAndMethod, TestMethodDisplayOptions.None, testMethod, testMethodArguments) =>
2626
SkipReason = skipReason ?? "skipped";
2727

28+
public int Timeout => 0;
29+
2830
/// <inheritdoc />
2931
public Task<RunSummary> RunAsync(
3032
IMessageSink diagnosticMessageSink,

0 commit comments

Comments
 (0)