Skip to content

Commit 956a241

Browse files
authored
V10.0.2/minor fixes (#39)
♻️ removed check on properties that are not callback delegates 🐛 fixed a non-critical bug that was triggered by xUnit reflection calls when a fixture was not in a valid state invoking ConfigureHost ♻️ tweaked code to be forgiving when no active test is present (xunit/xunit#2377) :package: updated NuGet package definition :speech_balloon: updated community health pages :arrow_up: bump dependencies :construction_worker: streamligning CI/CD
1 parent e6acd7b commit 956a241

File tree

13 files changed

+76
-18
lines changed

13 files changed

+76
-18
lines changed

.github/workflows/pipelines.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
configuration: [Debug, Release]
30-
uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v1
30+
uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v2
3131
with:
3232
configuration: ${{ matrix.configuration }}
3333
strong-name-key-filename: xunit.snk
@@ -41,10 +41,9 @@ jobs:
4141
strategy:
4242
matrix:
4343
configuration: [Debug, Release]
44-
uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v1
44+
uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v2
4545
with:
4646
configuration: ${{ matrix.configuration }}
47-
upload-packed-artifact: true
4847
version: ${{ needs.build.outputs.version }}
4948

5049
test:
@@ -55,7 +54,7 @@ jobs:
5554
matrix:
5655
os: [ubuntu-24.04, windows-2022]
5756
configuration: [Debug, Release]
58-
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v1
57+
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v2
5958
with:
6059
configuration: ${{ matrix.configuration }}
6160
runs-on: ${{ matrix.os }}
@@ -90,7 +89,7 @@ jobs:
9089
if: github.event_name != 'pull_request'
9190
name: call-nuget
9291
needs: [build, pack, test, sonarcloud, codecov, codeql]
93-
uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v1
92+
uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v2
9493
with:
9594
version: ${{ needs.build.outputs.version }}
9695
environment: Production

.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Version 10.0.1
1+
Version 10.0.2
2+
Availability: .NET 9 and .NET 8
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
7+
Version 10.0.1
28
Availability: .NET 9 and .NET 8
39

410
# ALM

.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
Version 10.0.1
1+
Version 10.0.2
2+
Availability: .NET 9 and .NET 8
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
7+
# Bug Fixes
8+
- FIXED ManagedWebHostFixture class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace to exit ConfigureHost method if the fixture is not in a valid state (e.g., configuration delegate properties are null)
9+
 
10+
# Improvements
11+
- CHANGED HasValidState method on the WebHostFixtureExtensions class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace to exclude check of Application property
12+
 
13+
Version 10.0.1
214
Availability: .NET 9 and .NET 8
315

416
# ALM

.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
Version 10.0.1
1+
Version 10.0.2
2+
Availability: .NET 9, .NET 8 and .NET Standard 2.0
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
7+
# Bug Fixes
8+
- FIXED ManagedHostFixture class in the Codebelt.Extensions.Xunit.Hosting namespace to exit ConfigureHost method if the fixture is not in a valid state (e.g., configuration delegate properties are null)
9+
 
10+
# Improvements
11+
- CHANGED HasValidState method on the GenericHostFixtureExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to exclude check of Host property
12+
- CHANGED AddXunitTestLogging method on the ServiceCollectionExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to be forgiving when no active test is present (relates to https://github.com/xunit/xunit/issues/2377)
13+
 
14+
Version 10.0.1
215
Availability: .NET 9, .NET 8 and .NET Standard 2.0
316

417
# ALM

.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Version 10.0.1
1+
Version 10.0.2
2+
Availability: .NET 9 and .NET 8
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
7+
Version 10.0.1
28
Availability: .NET 9 and .NET 8
39

410
# ALM

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ For more details, please refer to `PackageReleaseNotes.txt` on a per assembly ba
77
> [!NOTE]
88
> Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.Hosting, and Cuemon.Extensions.Xunit.Hosting.AspNetCore.
99
10+
## [10.0.2] - 2025-06-01
11+
12+
This is a minor update that addresses some non-critical issues and improves the overall developer experience of the package.
13+
14+
### Changed
15+
16+
- HasValidState method on the GenericHostFixtureExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to exclude check of Host property
17+
- AddXunitTestLogging method on the ServiceCollectionExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to be forgiving when no active test is present (relates to https://github.com/xunit/xunit/issues/2377)
18+
- You should use the ITestOutputHelperAccessor capability provided by AddXunitTestLoggingOutputHelperAccessor instead to set the ITestOutputHelper instance in your tests (e.g., in your constructor call `fixture.Host.Services.GetRequiredService<ITestOutputHelperAccessor>().TestOutput = output;`)
19+
20+
### Fixed
21+
22+
- ManagedHostFixture class in the Codebelt.Extensions.Xunit.Hosting namespace to exit ConfigureHost method if the fixture is not in a valid state (e.g., configuration delegate properties are null)
23+
- ManagedWebHostFixture class in the Codebelt.Extensions.Xunit.Hosting.AspNetCore namespace to exit ConfigureHost method if the fixture is not in a valid state (e.g., configuration delegate properties are null)
24+
1025
## [10.0.1] - 2025-05-24
1126

1227
This is a service update that focuses on package dependencies.

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageVersion Include="Cuemon.Extensions.AspNetCore" Version="9.0.5" />
99
<PackageVersion Include="Cuemon.Extensions.IO" Version="9.0.5" />
1010
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.5" />
11-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
1212
<PackageVersion Include="MinVer" Version="6.0.0" />
1313
<PackageVersion Include="NativeLibraryLoader" Version="1.0.13" />
1414
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/ManagedWebHostFixture.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public override void ConfigureHost(Test hostTest)
4040
{
4141
ArgumentNullException.ThrowIfNull(hostTest);
4242
if (!HasTypes(hostTest.GetType(), typeof(WebHostTest<>))) { throw new ArgumentOutOfRangeException(nameof(hostTest), typeof(WebHostTest<>), $"{nameof(hostTest)} is not assignable from WebHostTest<T>."); }
43+
if (!this.HasValidState()) { return; } // had to include this due to dual-call this method (one uncontrolled from xUnit library reflection magic; second controlled from this library)
4344

4445
var hb = new HostBuilder()
4546
.ConfigureWebHost(webBuilder =>
@@ -73,7 +74,7 @@ public override void ConfigureHost(Test hostTest)
7374
})
7475
.Configure(app =>
7576
{
76-
ConfigureApplicationCallback(app);
77+
ConfigureApplicationCallback.Invoke(app);
7778
Application = app;
7879
}
7980
)

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostFixtureExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ public static class WebHostFixtureExtensions
1212
/// <returns><c>true</c> if the specified <see cref="IWebHostFixture"/> has a valid state; otherwise, <c>false</c>.</returns>
1313
/// <remarks>
1414
/// A valid state is defined as having non-null values for the following properties:
15-
/// <see cref="IWebHostFixture.ConfigureApplicationCallback"/>, <see cref="IGenericHostFixture.ConfigureServicesCallback"/>, <see cref="IHostTest.Host"/>,
16-
/// <see cref="IGenericHostFixture.ConfigureHostCallback"/> and <see cref="IPipelineTest.Application"/>.
15+
/// <see cref="IWebHostFixture.ConfigureApplicationCallback"/>, <see cref="IGenericHostFixture.ConfigureServicesCallback"/> and <see cref="IGenericHostFixture.ConfigureHostCallback"/>.
1716
/// </remarks>
1817
public static bool HasValidState(this IWebHostFixture hostFixture)
1918
{
2019
var hasValidState = ((IGenericHostFixture)hostFixture).HasValidState();
21-
return hasValidState && hostFixture.ConfigureApplicationCallback != null && hostFixture.Application != null;
20+
return hasValidState && hostFixture.ConfigureApplicationCallback != null;
2221
}
2322
}
2423
}

src/Codebelt.Extensions.Xunit.Hosting/GenericHostFixtureExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ public static class GenericHostFixtureExtensions
1212
/// <returns><c>true</c> if the specified <see cref="IGenericHostFixture"/> has a valid state; otherwise, <c>false</c>.</returns>
1313
/// <remarks>
1414
/// A valid state is defined as having non-null values for the following properties:
15-
/// <see cref="IGenericHostFixture.ConfigureServicesCallback"/>, <see cref="IHostTest.Host"/> and <see cref="IGenericHostFixture.ConfigureHostCallback"/>.
15+
/// <see cref="IGenericHostFixture.ConfigureServicesCallback"/> and <see cref="IGenericHostFixture.ConfigureHostCallback"/>.
1616
/// </remarks>
1717
public static bool HasValidState(this IGenericHostFixture hostFixture)
1818
{
1919
return hostFixture.ConfigureServicesCallback != null &&
20-
hostFixture.Host != null &&
2120
hostFixture.ConfigureHostCallback != null;
2221
}
2322
}

0 commit comments

Comments
 (0)