From 7caaa44341b073413a247ac3dd38d4a8cb119cbd Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 2 Dec 2025 15:21:14 +0100
Subject: [PATCH 01/12] Fix broken tests in WSL2 on Ubuntu
---
.../FluentAssertionsExtensions.cs | 44 +++++++++++++++++++
.../DynamicConsoleLoggerProviderTest.cs | 2 +-
.../DynamicSerilogLoggerProviderTest.cs | 8 ++--
.../DynamicSerilog.Test/HostBuilderTest.cs | 16 +++----
.../AppTypes/ApiControllerTest.cs | 12 ++---
.../RouteMappings/AppTypes/MinimalApiTest.cs | 20 ++++-----
.../AppTypes/MvcControllerTest.cs | 12 ++---
.../AppTypes/RazorPagesExternalAppTest.cs | 9 ++--
.../RazorPagesWebApplicationFactory.cs | 29 ++++++++++++
src/testenvironments.json | 21 +++++----
10 files changed, 125 insertions(+), 48 deletions(-)
create mode 100644 src/Management/test/Endpoint.Test/Actuators/RouteMappings/RazorPagesWebApplicationFactory.cs
diff --git a/src/Common/test/TestResources/FluentAssertionsExtensions.cs b/src/Common/test/TestResources/FluentAssertionsExtensions.cs
index ef96ceb3b3..2b41838878 100644
--- a/src/Common/test/TestResources/FluentAssertionsExtensions.cs
+++ b/src/Common/test/TestResources/FluentAssertionsExtensions.cs
@@ -52,4 +52,48 @@ private static string ToJsonString(JsonDocument document)
writer.Flush();
return Encoding.UTF8.GetString(stream.ToArray());
}
+
+ ///
+ /// Same as the built-in Be() method, but allows specifying a custom comparer.
+ ///
+ ///
+ /// The source text to assert on.
+ ///
+ ///
+ /// The expected text.
+ ///
+ ///
+ /// An equality comparer to compare values.
+ ///
+ [CustomAssertion]
+ public static void Be(this StringAssertions source, string expected, IEqualityComparer comparer)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ ArgumentNullException.ThrowIfNull(expected);
+ ArgumentNullException.ThrowIfNull(comparer);
+
+ object subject = source.Subject;
+ subject.Should().Be(expected, comparer);
+ }
+
+ ///
+ /// Same as the built-in Contain() method, but normalizes line endings upfront.
+ ///
+ ///
+ /// The source text to assert on.
+ ///
+ ///
+ /// The expected text.
+ ///
+ [CustomAssertion]
+ public static void ContainLines(this StringAssertions source, string expected)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ ArgumentNullException.ThrowIfNull(expected);
+
+ string sourceText = source.Subject.ReplaceLineEndings();
+ string expectedText = expected.ReplaceLineEndings();
+
+ sourceText.Should().Contain(expectedText);
+ }
}
diff --git a/src/Logging/test/DynamicConsole.Test/DynamicConsoleLoggerProviderTest.cs b/src/Logging/test/DynamicConsole.Test/DynamicConsoleLoggerProviderTest.cs
index 9e237a86a9..3e85796499 100644
--- a/src/Logging/test/DynamicConsole.Test/DynamicConsoleLoggerProviderTest.cs
+++ b/src/Logging/test/DynamicConsole.Test/DynamicConsoleLoggerProviderTest.cs
@@ -504,7 +504,7 @@ public async Task CanUseJsonFormatterWithScopes()
]
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
diff --git a/src/Logging/test/DynamicSerilog.Test/DynamicSerilogLoggerProviderTest.cs b/src/Logging/test/DynamicSerilog.Test/DynamicSerilogLoggerProviderTest.cs
index 36c985c212..682a90fdc4 100644
--- a/src/Logging/test/DynamicSerilog.Test/DynamicSerilogLoggerProviderTest.cs
+++ b/src/Logging/test/DynamicSerilog.Test/DynamicSerilogLoggerProviderTest.cs
@@ -287,7 +287,7 @@ public void CanUseScopes()
[INF] Fully.Qualified.Type: {InnerScopeKey="InnerScopeValue", Scope=["OuterScope", "InnerScope=InnerScopeValue"]}
TestInfo
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -331,7 +331,7 @@ public void CanUseSerilogEnrichers()
[INF] Fully.Qualified.Type: {A=1}
Carries property A = 1, again
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -360,7 +360,7 @@ public void CanUseSerilogDestructuring()
logOutput.Should().Be("""
[INF] Fully.Qualified.Type: Processing of {"RequestUrl": "https://www.example.com", "UserAgent": "Steeltoe"} started.
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -391,7 +391,7 @@ public void CallsIntoMessageProcessors()
[INF] {SourceContext="Test", Scope=["TwoOne"]}
Three
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
private static IDynamicLoggerProvider CreateLoggerProvider(Action? configure = null)
diff --git a/src/Logging/test/DynamicSerilog.Test/HostBuilderTest.cs b/src/Logging/test/DynamicSerilog.Test/HostBuilderTest.cs
index fa38276223..151b001ca2 100644
--- a/src/Logging/test/DynamicSerilog.Test/HostBuilderTest.cs
+++ b/src/Logging/test/DynamicSerilog.Test/HostBuilderTest.cs
@@ -91,12 +91,12 @@ public async Task CanPreserveDefaultConsoleLoggerProvider()
logOutput.Should().Contain("SERILOG [INF] TestInfo");
logOutput.Should().Contain("SERILOG [ERR] TestError");
- logOutput.Should().Contain($"""
+ logOutput.Should().ContainLines($"""
info: {typeof(HostBuilderTest)}[0]
TestInfo
""");
- logOutput.Should().Contain($"""
+ logOutput.Should().ContainLines($"""
fail: {typeof(HostBuilderTest)}[0]
TestError
""");
@@ -133,7 +133,7 @@ public async Task CanConfigureSerilogWithoutLevelsConfiguration()
[INF] TestInfo
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -167,7 +167,7 @@ public async Task CanConfigureSerilogFromConfigurationWithDefaultLevel()
logOutput.Should().Be("""
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -201,7 +201,7 @@ public async Task CanConfigureSerilogFromConfigurationWithShortKeyForDefaultLeve
logOutput.Should().Be("""
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -236,7 +236,7 @@ public async Task CanConfigureSerilogFromConfigurationWithOnlyOverrides()
logOutput.Should().Be("""
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -273,7 +273,7 @@ public async Task CanConfigureSerilogFromCodeWithDefaultLevel()
logOutput.Should().Be("""
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -311,7 +311,7 @@ public async Task CanConfigureSerilogFromCodeWithOnlyOverrides()
logOutput.Should().Be("""
[ERR] TestError
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
diff --git a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/ApiControllerTest.cs b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/ApiControllerTest.cs
index 24036e793d..5d17186e73 100644
--- a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/ApiControllerTest.cs
+++ b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/ApiControllerTest.cs
@@ -91,7 +91,7 @@ public async Task Can_get_routes_for_simple_controller()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -208,7 +208,7 @@ public async Task Can_get_routes_for_controller_with_parameters_and_annotations(
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -398,7 +398,7 @@ public async Task Can_get_routes_for_multiple_verbs_in_single_action_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -461,7 +461,7 @@ public async Task Can_get_routes_for_any_verb_in_single_action_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -536,7 +536,7 @@ public async Task Can_get_routes_using_WebHostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -613,6 +613,6 @@ public async Task Can_get_routes_using_HostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
}
diff --git a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MinimalApiTest.cs b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MinimalApiTest.cs
index f4c586a17f..774a7248e1 100644
--- a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MinimalApiTest.cs
+++ b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MinimalApiTest.cs
@@ -83,7 +83,7 @@ public async Task Can_get_routes_for_handler_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -145,7 +145,7 @@ public async Task Can_get_routes_for_inline_lambda()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -268,7 +268,7 @@ public async Task Can_get_routes_for_inline_lambda_with_parameters_and_annotatio
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -364,7 +364,7 @@ public async Task Can_get_routes_for_multiple_verbs_in_single_endpoint()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -432,7 +432,7 @@ public async Task Can_get_routes_for_any_verb_in_single_endpoint()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -523,7 +523,7 @@ public async Task Can_get_routes_for_separate_verbs_in_single_endpoint()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -615,7 +615,7 @@ public async Task Can_get_routes_for_groups_using_same_handler_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -720,7 +720,7 @@ public async Task Can_get_routes_for_groups_using_inline_lambdas()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -781,7 +781,7 @@ public async Task Can_get_routes_using_WebHostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -845,7 +845,7 @@ public async Task Can_get_routes_using_HostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
private static string HandlePingRequest()
diff --git a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MvcControllerTest.cs b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MvcControllerTest.cs
index f261f0b125..f61f0f26ff 100644
--- a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MvcControllerTest.cs
+++ b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/MvcControllerTest.cs
@@ -136,7 +136,7 @@ public async Task Can_get_routes_for_simple_controller()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -300,7 +300,7 @@ public async Task Can_get_routes_for_controller_with_parameters_and_annotations(
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -432,7 +432,7 @@ public async Task Can_get_routes_for_multiple_verbs_in_single_action_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -511,7 +511,7 @@ public async Task Can_get_routes_for_any_verb_in_single_action_method()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -630,7 +630,7 @@ public async Task Can_get_routes_using_WebHostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
[Fact]
@@ -750,6 +750,6 @@ public async Task Can_get_routes_using_HostBuilder()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
}
diff --git a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/RazorPagesExternalAppTest.cs b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/RazorPagesExternalAppTest.cs
index 83bbcdaa92..8b0f91b08a 100644
--- a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/RazorPagesExternalAppTest.cs
+++ b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/AppTypes/RazorPagesExternalAppTest.cs
@@ -3,14 +3,13 @@
// See the LICENSE file in the project root for more information.
using System.Net;
-using Microsoft.AspNetCore.Mvc.Testing;
-using Steeltoe.Management.Endpoint.RazorPagesTestWebApp.Pages;
+using Steeltoe.Common.TestResources;
namespace Steeltoe.Management.Endpoint.Test.Actuators.RouteMappings.AppTypes;
-public sealed class RazorPagesExternalAppTest(WebApplicationFactory factory) : IClassFixture>
+public sealed class RazorPagesExternalAppTest(RazorPagesWebApplicationFactory factory) : IClassFixture
{
- private readonly WebApplicationFactory _factory = factory;
+ private readonly RazorPagesWebApplicationFactory _factory = factory;
[Fact]
public async Task Can_get_routes_for_razor_pages()
@@ -272,6 +271,6 @@ public async Task Can_get_routes_for_razor_pages()
}
}
}
- """);
+ """, IgnoreLineEndingsComparer.Instance);
}
}
diff --git a/src/Management/test/Endpoint.Test/Actuators/RouteMappings/RazorPagesWebApplicationFactory.cs b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/RazorPagesWebApplicationFactory.cs
new file mode 100644
index 0000000000..322e07311b
--- /dev/null
+++ b/src/Management/test/Endpoint.Test/Actuators/RouteMappings/RazorPagesWebApplicationFactory.cs
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc.Testing;
+using Steeltoe.Management.Endpoint.RazorPagesTestWebApp.Pages;
+using Steeltoe.Management.Endpoint.Test.Actuators.RouteMappings.AppTypes;
+
+namespace Steeltoe.Management.Endpoint.Test.Actuators.RouteMappings;
+
+public sealed class RazorPagesWebApplicationFactory : WebApplicationFactory
+{
+ protected override void ConfigureWebHost(IWebHostBuilder builder)
+ {
+ string? testAssemblyName = typeof(RazorPagesExternalAppTest).Assembly.GetName().Name;
+ string? appAssemblyName = typeof(IndexModel).Assembly.GetName().Name;
+
+ string absoluteContentRoot = System.Environment.CurrentDirectory;
+ absoluteContentRoot = absoluteContentRoot.Replace($"/{testAssemblyName}/", $"/{appAssemblyName}/", StringComparison.Ordinal);
+ absoluteContentRoot = absoluteContentRoot.Replace($@"\{testAssemblyName}\", $@"\{appAssemblyName}\", StringComparison.Ordinal);
+
+ // Workaround for https://github.com/dotnet/aspnetcore/issues/55867.
+ builder.UseContentRoot(absoluteContentRoot);
+
+ // Workaround for https://github.com/dotnet/aspnetcore/issues/55867#issuecomment-3046941805.
+ builder.UseEnvironment("Production");
+ }
+}
diff --git a/src/testenvironments.json b/src/testenvironments.json
index 539ead6b04..ebd64f1380 100644
--- a/src/testenvironments.json
+++ b/src/testenvironments.json
@@ -1,10 +1,15 @@
{
- "version": "1",
- "environments": [
- {
- "name": "Ubuntu",
- "type": "wsl",
- "wslDistribution": "Ubuntu"
- }
- ]
+ "version": "1",
+ "environments": [
+ {
+ "name": "Ubuntu",
+ "type": "wsl",
+ "wslDistribution": "Ubuntu"
+ },
+ {
+ "name": "Ubuntu-22.04",
+ "type": "wsl",
+ "wslDistribution": "Ubuntu-22.04"
+ }
+ ]
}
From 08b5a8fbe41397c055ee5fd91e2f07471e95b7fc Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 13:25:39 +0100
Subject: [PATCH 02/12] Run tests for all frameworks in single command,
explicitly use VSTest mode
---
.github/workflows/Steeltoe.All.yml | 36 +++++--------------
.../workflows/component-shared-workflow.yml | 28 ++++-----------
.github/workflows/sonarcube.yml | 22 +++---------
Directory.Build.targets | 4 +--
shared-test.props | 9 ++---
src/Steeltoe.All.sln | 2 +-
6 files changed, 26 insertions(+), 75 deletions(-)
diff --git a/.github/workflows/Steeltoe.All.yml b/.github/workflows/Steeltoe.All.yml
index d4b5897ca1..ad15634f6a 100644
--- a/.github/workflows/Steeltoe.All.yml
+++ b/.github/workflows/Steeltoe.All.yml
@@ -21,7 +21,7 @@ env:
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.All.sln'
COMMON_TEST_ARGS: >-
- --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/dumps
+ --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
--settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
jobs:
@@ -36,9 +36,9 @@ jobs:
- os: ubuntu-latest
runDockerContainers: true
- os: windows-latest
- skipFilter: Category!=Integration
+ skipIntegrationTests: true
- os: macos-latest
- skipFilter: Category!=Integration
+ skipIntegrationTests: true
runs-on: ${{ matrix.os }}
continue-on-error: true
@@ -89,29 +89,11 @@ jobs:
- name: Build solution
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
- - name: Set skip filters for tests
- shell: bash
- run: |
- echo SKIP_FILTER_NO_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category!=MemoryDumps', matrix.skipFilter) || 'Category!=MemoryDumps' }}" >> $GITHUB_ENV
- echo SKIP_FILTER_WITH_MEMORY_DUMPS="${{ matrix.skipFilter && format('{0}&Category=MemoryDumps', matrix.skipFilter) || 'Category=MemoryDumps' }}" >> $GITHUB_ENV
-
- - name: Test (net10.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net10.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net9.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net9.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net8.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_NO_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
+ - name: Test
+ run: dotnet test ${{ env.SOLUTION_FILE }} --filter "${{ matrix.skipIntegrationTests == true && 'Category!=MemoryDumps&Category!=Integration' || 'Category!=MemoryDumps' }}" ${{ env.COMMON_TEST_ARGS }}
- - name: Test (net8.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "${{ env.SKIP_FILTER_WITH_MEMORY_DUMPS }}" ${{ env.COMMON_TEST_ARGS }}
+ - name: Test (memory dumps)
+ run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
- name: Upload crash/hang dumps (on failure)
if: ${{ failure() }}
@@ -119,8 +101,8 @@ jobs:
with:
name: FailedTestOutput-${{ matrix.os }}
path: |
- ${{ github.workspace }}/dumps/**/*.dmp
- ${{ github.workspace }}/dumps/**/Sequence_*.xml
+ ${{ github.workspace }}/TestOutput/**/*.dmp
+ ${{ github.workspace }}/TestOutput/**/Sequence_*.xml
if-no-files-found: ignore
- name: Report test results
diff --git a/.github/workflows/component-shared-workflow.yml b/.github/workflows/component-shared-workflow.yml
index 229e2f5801..e2950ca484 100644
--- a/.github/workflows/component-shared-workflow.yml
+++ b/.github/workflows/component-shared-workflow.yml
@@ -23,7 +23,7 @@ env:
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.${{ inputs.component }}.slnf'
COMMON_TEST_ARGS: >-
- --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/dumps
+ --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
--settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
jobs:
@@ -79,26 +79,12 @@ jobs:
- name: Build solution
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
- - name: Test (net10.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
+ - name: Test
+ run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
- - name: Test (net10.0) (memory dumps)
+ - name: Test (memory dumps)
if: ${{ inputs.component == 'Management' }}
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net10.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net9.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net9.0) (memory dumps)
- if: ${{ inputs.component == 'Management' }}
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net9.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net8.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
-
- - name: Test (net8.0) (memory dumps)
- if: ${{ inputs.component == 'Management' }}
- run: dotnet test ${{ env.SOLUTION_FILE }} --framework net8.0 --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
+ run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }}
- name: Upload crash/hang dumps (on failure)
if: ${{ failure() }}
@@ -106,8 +92,8 @@ jobs:
with:
name: FailedTestOutput-${{ inputs.OS }}-latest
path: |
- ${{ github.workspace }}/dumps/**/*.dmp
- ${{ github.workspace }}/dumps/**/Sequence_*.xml
+ ${{ github.workspace }}/TestOutput/**/*.dmp
+ ${{ github.workspace }}/TestOutput/**/Sequence_*.xml
if-no-files-found: ignore
- name: Report test results
diff --git a/.github/workflows/sonarcube.yml b/.github/workflows/sonarcube.yml
index 2fcebd9f8a..3c9d538750 100644
--- a/.github/workflows/sonarcube.yml
+++ b/.github/workflows/sonarcube.yml
@@ -22,7 +22,7 @@ env:
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.All.sln'
SONAR_TEST_ARGS: >-
- --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}
+ --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
--settings coverlet.runsettings -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.UseSourceLink=false
jobs:
@@ -79,23 +79,11 @@ jobs:
- name: Build solution
run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal
- - name: Test (net10.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
+ - name: Test
+ run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.SONAR_TEST_ARGS }}
- - name: Test (net10.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net10.0 ${{ env.SONAR_TEST_ARGS }}
-
- - name: Test (net9.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
-
- - name: Test (net9.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net9.0 ${{ env.SONAR_TEST_ARGS }}
-
- - name: Test (net8.0)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
-
- - name: Test (net8.0) (memory dumps)
- run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category=MemoryDumps" --framework net8.0 ${{ env.SONAR_TEST_ARGS }}
+ - name: Test (memory dumps)
+ run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.SONAR_TEST_ARGS }}
- name: End Sonar .NET scanner
if: ${{ !cancelled() && steps.sonar_begin.outcome == 'success' }}
diff --git a/Directory.Build.targets b/Directory.Build.targets
index b59583d8cd..a3b1a1a4f5 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -101,7 +101,7 @@
-
+
@@ -123,7 +123,7 @@
+ Text="ConfigurationSchema.json is out of date for $(MSBuildProjectFile). Run 'dotnet build --no-incremental /p:UpdateConfigurationSchema=true' to update it." />
diff --git a/shared-test.props b/shared-test.props
index 16dad857a8..587bc9421e 100644
--- a/shared-test.props
+++ b/shared-test.props
@@ -1,13 +1,8 @@
Exe
- $(NoWarn);S2094;S3717;SA1602;CA1062;CA1707;NU5104
-
-
-
-
false
- true
+ $(NoWarn);S2094;S3717;SA1602;CA1062;CA1707;NU5104
@@ -22,7 +17,7 @@
-
+
diff --git a/src/Steeltoe.All.sln b/src/Steeltoe.All.sln
index 1e8a438ee2..43d8724a28 100644
--- a/src/Steeltoe.All.sln
+++ b/src/Steeltoe.All.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
-VisualStudioVersion = 18.0.11222.15 d18.0
+VisualStudioVersion = 18.0.11222.15
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Common", "Common\src\Common\Steeltoe.Common.csproj", "{61812938-5132-4AB6-B48D-2DF4189B3E37}"
EndProject
From eefc234a17a6058a5fbfb2bcb58200d9a884db5d Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 13:47:08 +0100
Subject: [PATCH 03/12] Add diagnostics to investigate intermittent hostname
lookup failures on macOS
---
.github/workflows/Steeltoe.All.yml | 1 +
.../workflows/component-shared-workflow.yml | 1 +
.github/workflows/sonarcube.yml | 1 +
.../src/Common/Net/DomainNameResolver.cs | 33 +++++++++++++++++--
.../src/Consul/Registry/ConsulRegistration.cs | 16 ++++++++-
5 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/Steeltoe.All.yml b/.github/workflows/Steeltoe.All.yml
index ad15634f6a..f73feb5af1 100644
--- a/.github/workflows/Steeltoe.All.yml
+++ b/.github/workflows/Steeltoe.All.yml
@@ -17,6 +17,7 @@ permissions:
pull-requests: write
env:
+ STEELTOE_MACOS_DIAGNOSE_HOSTNAME_LOOKUP: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.All.sln'
diff --git a/.github/workflows/component-shared-workflow.yml b/.github/workflows/component-shared-workflow.yml
index e2950ca484..671272ca7d 100644
--- a/.github/workflows/component-shared-workflow.yml
+++ b/.github/workflows/component-shared-workflow.yml
@@ -19,6 +19,7 @@ permissions:
pull-requests: write
env:
+ STEELTOE_MACOS_DIAGNOSE_HOSTNAME_LOOKUP: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.${{ inputs.component }}.slnf'
diff --git a/.github/workflows/sonarcube.yml b/.github/workflows/sonarcube.yml
index 3c9d538750..c336b6e073 100644
--- a/.github/workflows/sonarcube.yml
+++ b/.github/workflows/sonarcube.yml
@@ -18,6 +18,7 @@ permissions:
pull-requests: write
env:
+ STEELTOE_MACOS_DIAGNOSE_HOSTNAME_LOOKUP: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true
SOLUTION_FILE: 'src/Steeltoe.All.sln'
diff --git a/src/Common/src/Common/Net/DomainNameResolver.cs b/src/Common/src/Common/Net/DomainNameResolver.cs
index 0b1da12ddd..f174744b31 100644
--- a/src/Common/src/Common/Net/DomainNameResolver.cs
+++ b/src/Common/src/Common/Net/DomainNameResolver.cs
@@ -9,6 +9,8 @@ namespace Steeltoe.Common.Net;
internal sealed class DomainNameResolver : IDomainNameResolver
{
+ private static readonly bool IsInDiagnosticsMode = Environment.GetEnvironmentVariable("STEELTOE_MACOS_DIAGNOSE_HOSTNAME_LOOKUP") == "true";
+
public static DomainNameResolver Instance { get; } = new();
private DomainNameResolver()
@@ -42,22 +44,44 @@ private DomainNameResolver()
public string? ResolveHostName(bool throwOnError = false)
{
+ // Gather diagnostic information to investigate intermittent failures on macOS.
+ string? resultFromGetHostName = null;
+ string? resultFromGetHostEntry = null;
+ bool? workaroundApplied = null;
+
try
{
string hostName = Dns.GetHostName();
+ resultFromGetHostName = hostName;
if (string.IsNullOrEmpty(hostName))
{
// Workaround for failure when running on macOS.
// See https://github.com/actions/runner-images/issues/1335 and https://github.com/dotnet/runtime/issues/36849.
+
hostName = "localhost";
+ workaroundApplied = true;
}
IPHostEntry hostEntry = Dns.GetHostEntry(hostName);
- return hostEntry.HostName;
+ resultFromGetHostEntry = hostEntry.HostName;
+
+ if (IsInDiagnosticsMode && string.IsNullOrEmpty(resultFromGetHostEntry))
+ {
+ throw new InvalidOperationException($"IPHostEntry.HostName returned {GetTextFor(resultFromGetHostEntry)}.");
+ }
+
+ return resultFromGetHostEntry;
}
- catch (Exception)
+ catch (Exception exception)
{
+ if (IsInDiagnosticsMode)
+ {
+ throw new InvalidOperationException(
+ $"Failed to resolve hostname. GetHostName={GetTextFor(resultFromGetHostName)}, GetHostEntry={GetTextFor(resultFromGetHostEntry)}, WorkaroundApplied={workaroundApplied}",
+ exception);
+ }
+
if (throwOnError)
{
throw;
@@ -66,4 +90,9 @@ private DomainNameResolver()
return null;
}
}
+
+ private static string GetTextFor(string? value)
+ {
+ return value == null ? "(null)" : "(empty)";
+ }
}
diff --git a/src/Discovery/src/Consul/Registry/ConsulRegistration.cs b/src/Discovery/src/Consul/Registry/ConsulRegistration.cs
index c8861fd4d4..81bd573afc 100644
--- a/src/Discovery/src/Consul/Registry/ConsulRegistration.cs
+++ b/src/Discovery/src/Consul/Registry/ConsulRegistration.cs
@@ -35,7 +35,7 @@ internal sealed class ConsulRegistration : IServiceInstance
public bool IsSecure => _optionsMonitor.CurrentValue.EffectiveScheme == "https";
///
- public Uri Uri => new($"{_optionsMonitor.CurrentValue.EffectiveScheme}://{Host}:{Port}");
+ public Uri Uri => FormatUri();
///
public Uri? NonSecureUri => IsSecure ? null : Uri;
@@ -73,6 +73,20 @@ internal ConsulRegistration(AgentServiceRegistration innerRegistration, IOptions
Metadata = innerRegistration.Meta.AsReadOnly();
}
+ private Uri FormatUri()
+ {
+ string scheme = _optionsMonitor.CurrentValue.EffectiveScheme;
+
+ try
+ {
+ return new Uri($"{scheme}://{Host}:{Port}");
+ }
+ catch (UriFormatException exception)
+ {
+ throw new UriFormatException($"Failed to build URI from components. Scheme={scheme}, Host={Host},Port={Port}.", exception);
+ }
+ }
+
///
/// Creates a registration for the currently running app, to be submitted to the Consul server.
///
From 0028a235dec536225b4818c7a012b78c95b917ba Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 14:37:52 +0100
Subject: [PATCH 04/12] Add workaround to enable hang/crashdumps on macOS
---
Directory.Build.targets | 8 +++++++-
macos-dump-entitlements.plist | 16 ++++++++++++++++
src/Common/src/Common/Net/DomainNameResolver.cs | 7 ++++++-
3 files changed, 29 insertions(+), 2 deletions(-)
create mode 100644 macos-dump-entitlements.plist
diff --git a/Directory.Build.targets b/Directory.Build.targets
index a3b1a1a4f5..65ab7c7c73 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -1,6 +1,12 @@
+
+
+
+
+
diff --git a/macos-dump-entitlements.plist b/macos-dump-entitlements.plist
new file mode 100644
index 0000000000..41bb93a0c7
--- /dev/null
+++ b/macos-dump-entitlements.plist
@@ -0,0 +1,16 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+ com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.debugger
+
+ com.apple.security.get-task-allow
+
+
+
\ No newline at end of file
diff --git a/src/Common/src/Common/Net/DomainNameResolver.cs b/src/Common/src/Common/Net/DomainNameResolver.cs
index f174744b31..30fd0e55bd 100644
--- a/src/Common/src/Common/Net/DomainNameResolver.cs
+++ b/src/Common/src/Common/Net/DomainNameResolver.cs
@@ -93,6 +93,11 @@ private DomainNameResolver()
private static string GetTextFor(string? value)
{
- return value == null ? "(null)" : "(empty)";
+ if (value == null)
+ {
+ return "(null)";
+ }
+
+ return value.Length == 0 ? "(empty)" : value;
}
}
From 40542fc01a9f20bca3dbcecbefe61f07ec3b57a0 Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 17:26:46 +0100
Subject: [PATCH 05/12] Reduce hang timeout (otherwise component job is killed
before dump is uploaded)
---
.github/workflows/Steeltoe.All.yml | 2 +-
.github/workflows/component-shared-workflow.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/Steeltoe.All.yml b/.github/workflows/Steeltoe.All.yml
index f73feb5af1..bb88a9492c 100644
--- a/.github/workflows/Steeltoe.All.yml
+++ b/.github/workflows/Steeltoe.All.yml
@@ -23,7 +23,7 @@ env:
SOLUTION_FILE: 'src/Steeltoe.All.sln'
COMMON_TEST_ARGS: >-
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
- --settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
+ --settings coverlet.runsettings --blame-crash --blame-hang-timeout 1m
jobs:
analyze:
diff --git a/.github/workflows/component-shared-workflow.yml b/.github/workflows/component-shared-workflow.yml
index 671272ca7d..52ca149a42 100644
--- a/.github/workflows/component-shared-workflow.yml
+++ b/.github/workflows/component-shared-workflow.yml
@@ -25,7 +25,7 @@ env:
SOLUTION_FILE: 'src/Steeltoe.${{ inputs.component }}.slnf'
COMMON_TEST_ARGS: >-
--no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput
- --settings coverlet.runsettings --blame-crash --blame-hang-timeout 3m
+ --settings coverlet.runsettings --blame-crash --blame-hang-timeout 1m
jobs:
build:
From cc875b0eaa9de82b56f1522db8f866c05e9a8bd1 Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 14:01:11 +0100
Subject: [PATCH 06/12] TEST: Add new tests to verify coverage diff
---
src/Common/src/Common/Calculator.cs | 23 +++++++++++++++++++
src/Common/src/Common/PublicAPI.Unshipped.txt | 4 ++++
src/Common/test/Common.Test/CalculatorTest.cs | 22 ++++++++++++++++++
3 files changed, 49 insertions(+)
create mode 100644 src/Common/src/Common/Calculator.cs
create mode 100644 src/Common/test/Common.Test/CalculatorTest.cs
diff --git a/src/Common/src/Common/Calculator.cs b/src/Common/src/Common/Calculator.cs
new file mode 100644
index 0000000000..7ac7bba3dc
--- /dev/null
+++ b/src/Common/src/Common/Calculator.cs
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+namespace Steeltoe.Common;
+
+public sealed class Calculator
+{
+ public int Add(int left, int right)
+ {
+ if (left < 0 || right < 0)
+ {
+ throw new ArgumentException("Only non-negative integers are allowed.");
+ }
+
+ return left + right;
+ }
+
+ public int Subtract(int left, int right)
+ {
+ return left - right;
+ }
+}
diff --git a/src/Common/src/Common/PublicAPI.Unshipped.txt b/src/Common/src/Common/PublicAPI.Unshipped.txt
index 4d8338db45..37bf23d14d 100644
--- a/src/Common/src/Common/PublicAPI.Unshipped.txt
+++ b/src/Common/src/Common/PublicAPI.Unshipped.txt
@@ -1,4 +1,8 @@
#nullable enable
+Steeltoe.Common.Calculator
+Steeltoe.Common.Calculator.Add(int left, int right) -> int
+Steeltoe.Common.Calculator.Calculator() -> void
+Steeltoe.Common.Calculator.Subtract(int left, int right) -> int
Steeltoe.Common.Discovery.IServiceInstance.InstanceId.get -> string!
Steeltoe.Common.Discovery.IServiceInstance.NonSecureUri.get -> System.Uri?
Steeltoe.Common.Discovery.IServiceInstance.SecureUri.get -> System.Uri?
diff --git a/src/Common/test/Common.Test/CalculatorTest.cs b/src/Common/test/Common.Test/CalculatorTest.cs
new file mode 100644
index 0000000000..0707844391
--- /dev/null
+++ b/src/Common/test/Common.Test/CalculatorTest.cs
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+namespace Steeltoe.Common.Test;
+
+public sealed class CalculatorTest
+{
+ [Fact]
+ public void Add_Returns_Correct_Sum()
+ {
+ var calculator = new Calculator();
+ int result = calculator.Add(3, 5);
+ result.Should().Be(8);
+ }
+
+ [Fact(Skip = "ExampleSkippedTest")]
+ public void SkippedTest()
+ {
+ true.Should().BeFalse();
+ }
+}
From c83f0a17f84b4abe6f84413ad60f29e7bc7faea8 Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 14:14:23 +0100
Subject: [PATCH 07/12] Revert "TEST: Add new tests to verify coverage diff"
This reverts commit 28263c52a14a51be59d4f036ea4b117e09eaf3c0.
---
src/Common/src/Common/Calculator.cs | 23 -------------------
src/Common/src/Common/PublicAPI.Unshipped.txt | 4 ----
src/Common/test/Common.Test/CalculatorTest.cs | 22 ------------------
3 files changed, 49 deletions(-)
delete mode 100644 src/Common/src/Common/Calculator.cs
delete mode 100644 src/Common/test/Common.Test/CalculatorTest.cs
diff --git a/src/Common/src/Common/Calculator.cs b/src/Common/src/Common/Calculator.cs
deleted file mode 100644
index 7ac7bba3dc..0000000000
--- a/src/Common/src/Common/Calculator.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the Apache 2.0 License.
-// See the LICENSE file in the project root for more information.
-
-namespace Steeltoe.Common;
-
-public sealed class Calculator
-{
- public int Add(int left, int right)
- {
- if (left < 0 || right < 0)
- {
- throw new ArgumentException("Only non-negative integers are allowed.");
- }
-
- return left + right;
- }
-
- public int Subtract(int left, int right)
- {
- return left - right;
- }
-}
diff --git a/src/Common/src/Common/PublicAPI.Unshipped.txt b/src/Common/src/Common/PublicAPI.Unshipped.txt
index 37bf23d14d..4d8338db45 100644
--- a/src/Common/src/Common/PublicAPI.Unshipped.txt
+++ b/src/Common/src/Common/PublicAPI.Unshipped.txt
@@ -1,8 +1,4 @@
#nullable enable
-Steeltoe.Common.Calculator
-Steeltoe.Common.Calculator.Add(int left, int right) -> int
-Steeltoe.Common.Calculator.Calculator() -> void
-Steeltoe.Common.Calculator.Subtract(int left, int right) -> int
Steeltoe.Common.Discovery.IServiceInstance.InstanceId.get -> string!
Steeltoe.Common.Discovery.IServiceInstance.NonSecureUri.get -> System.Uri?
Steeltoe.Common.Discovery.IServiceInstance.SecureUri.get -> System.Uri?
diff --git a/src/Common/test/Common.Test/CalculatorTest.cs b/src/Common/test/Common.Test/CalculatorTest.cs
deleted file mode 100644
index 0707844391..0000000000
--- a/src/Common/test/Common.Test/CalculatorTest.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the Apache 2.0 License.
-// See the LICENSE file in the project root for more information.
-
-namespace Steeltoe.Common.Test;
-
-public sealed class CalculatorTest
-{
- [Fact]
- public void Add_Returns_Correct_Sum()
- {
- var calculator = new Calculator();
- int result = calculator.Add(3, 5);
- result.Should().Be(8);
- }
-
- [Fact(Skip = "ExampleSkippedTest")]
- public void SkippedTest()
- {
- true.Should().BeFalse();
- }
-}
From c8095db88b4585f9d4e223a9bf3193a37efc5a4d Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 14:17:14 +0100
Subject: [PATCH 08/12] TEST: Add test that crashes with StackOverflowException
---
.../test/RandomValue.Test/CrashTest.cs | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 src/Configuration/test/RandomValue.Test/CrashTest.cs
diff --git a/src/Configuration/test/RandomValue.Test/CrashTest.cs b/src/Configuration/test/RandomValue.Test/CrashTest.cs
new file mode 100644
index 0000000000..5d4b49f6a7
--- /dev/null
+++ b/src/Configuration/test/RandomValue.Test/CrashTest.cs
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+#pragma warning disable
+// Resharper disable All
+
+namespace Steeltoe.Configuration.RandomValue.Test;
+
+public sealed class CrashTest
+{
+ [Fact]
+ public void AlwaysCrash()
+ {
+ InfiniteRecursion();
+ true.Should().BeTrue();
+ }
+
+ private static void InfiniteRecursion()
+ {
+ InfiniteRecursion();
+ }
+}
From b31453933d14d6208da07d8fe4749edb378e3676 Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 17:05:42 +0100
Subject: [PATCH 09/12] Revert "TEST: Add test that crashes with
StackOverflowException"
This reverts commit 4f84d3cfd78767412aaab2e35d8dc9a0ecb91b3a.
---
.../test/RandomValue.Test/CrashTest.cs | 23 -------------------
1 file changed, 23 deletions(-)
delete mode 100644 src/Configuration/test/RandomValue.Test/CrashTest.cs
diff --git a/src/Configuration/test/RandomValue.Test/CrashTest.cs b/src/Configuration/test/RandomValue.Test/CrashTest.cs
deleted file mode 100644
index 5d4b49f6a7..0000000000
--- a/src/Configuration/test/RandomValue.Test/CrashTest.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the Apache 2.0 License.
-// See the LICENSE file in the project root for more information.
-
-#pragma warning disable
-// Resharper disable All
-
-namespace Steeltoe.Configuration.RandomValue.Test;
-
-public sealed class CrashTest
-{
- [Fact]
- public void AlwaysCrash()
- {
- InfiniteRecursion();
- true.Should().BeTrue();
- }
-
- private static void InfiniteRecursion()
- {
- InfiniteRecursion();
- }
-}
From 251ca8de87928ea2ba2ec3261b343a2b1eb41c9e Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Tue, 9 Dec 2025 14:18:49 +0100
Subject: [PATCH 10/12] TEST: Add test that never completes
---
.../test/DynamicConsole.Test/HangTest.cs | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 src/Logging/test/DynamicConsole.Test/HangTest.cs
diff --git a/src/Logging/test/DynamicConsole.Test/HangTest.cs b/src/Logging/test/DynamicConsole.Test/HangTest.cs
new file mode 100644
index 0000000000..c78016f028
--- /dev/null
+++ b/src/Logging/test/DynamicConsole.Test/HangTest.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the Apache 2.0 License.
+// See the LICENSE file in the project root for more information.
+
+#pragma warning disable
+// Resharper disable All
+
+namespace Steeltoe.Logging.DynamicConsole.Test;
+
+public sealed class HangTest
+{
+ [Fact]
+ public void RunForever()
+ {
+ while (true)
+ {
+ ;
+ }
+ }
+}
From 9c2ee23407a363c7bf309da3dcac6209bb571d0d Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Thu, 11 Dec 2025 11:28:03 +0100
Subject: [PATCH 11/12] Revert "TEST: Add test that never completes"
This reverts commit 251ca8de87928ea2ba2ec3261b343a2b1eb41c9e.
---
.../test/DynamicConsole.Test/HangTest.cs | 20 -------------------
1 file changed, 20 deletions(-)
delete mode 100644 src/Logging/test/DynamicConsole.Test/HangTest.cs
diff --git a/src/Logging/test/DynamicConsole.Test/HangTest.cs b/src/Logging/test/DynamicConsole.Test/HangTest.cs
deleted file mode 100644
index c78016f028..0000000000
--- a/src/Logging/test/DynamicConsole.Test/HangTest.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the Apache 2.0 License.
-// See the LICENSE file in the project root for more information.
-
-#pragma warning disable
-// Resharper disable All
-
-namespace Steeltoe.Logging.DynamicConsole.Test;
-
-public sealed class HangTest
-{
- [Fact]
- public void RunForever()
- {
- while (true)
- {
- ;
- }
- }
-}
From 70d622f43be607f43e8dbad7b068e7678f5ea517 Mon Sep 17 00:00:00 2001
From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
Date: Fri, 12 Dec 2025 13:12:21 +0100
Subject: [PATCH 12/12] Fixed: unable to discover tests in WSL
Based on https://github.com/xunit/xunit/issues/3457#issuecomment-3645960475
---
shared-test.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shared-test.props b/shared-test.props
index 587bc9421e..120065dd28 100644
--- a/shared-test.props
+++ b/shared-test.props
@@ -17,7 +17,7 @@
-
+