From 80305ac6635736b4e8a7ea5f15b6934869eb6aa0 Mon Sep 17 00:00:00 2001 From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com> Date: Fri, 28 Nov 2025 13:25:43 +0100 Subject: [PATCH 1/7] Update to xUnit v3 on Microsoft Testing Platform v2 --- .github/workflows/Steeltoe.All.yml | 18 ++++++----- .../workflows/component-shared-workflow.yml | 16 ++++++---- .github/workflows/sonarcube.yml | 19 ++++++++--- coverage.config | 29 +++++++++++++++++ coverage.sonar.config | 32 +++++++++++++++++++ coverlet.runsettings | 16 ---------- global.json | 5 +++ nuget.config | 6 +--- shared-test.props | 15 ++++++--- .../Steeltoe.Connectors.Test.csproj | 1 + .../FileSystem/NetworkShareWrapper.cs | 2 -- src/Steeltoe.All.sln | 3 +- versions.props | 6 ++-- 13 files changed, 117 insertions(+), 51 deletions(-) create mode 100644 coverage.config create mode 100644 coverage.sonar.config delete mode 100644 coverlet.runsettings create mode 100644 global.json diff --git a/.github/workflows/Steeltoe.All.yml b/.github/workflows/Steeltoe.All.yml index bb88a9492c..a5b65e8c0c 100644 --- a/.github/workflows/Steeltoe.All.yml +++ b/.github/workflows/Steeltoe.All.yml @@ -21,9 +21,10 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: true SOLUTION_FILE: 'src/Steeltoe.All.sln' + TEST_OUTPUT_DIRECTORY: '${{ github.workspace }}/TestOutput' 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 1m + --no-build --no-progress --configuration Release --results-directory '${{ github.workspace }}/TestOutput' + --report-trx --coverage --coverage-settings coverage.config --crashdump --hangdump --hangdump-timeout 1m jobs: analyze: @@ -91,10 +92,10 @@ jobs: run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal - name: Test - run: dotnet test ${{ env.SOLUTION_FILE }} --filter "${{ matrix.skipIntegrationTests == true && 'Category!=MemoryDumps&Category!=Integration' || 'Category!=MemoryDumps' }}" ${{ env.COMMON_TEST_ARGS }} + run: dotnet test --solution ${{ env.SOLUTION_FILE }} --filter-query "${{ matrix.skipIntegrationTests == true && '/[(Category!=MemoryDumps)&(Category!=Integration)]' || '/[Category!=MemoryDumps]' }}" ${{ env.COMMON_TEST_ARGS }} - name: Test (memory dumps) - run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} + run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter-trait "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Upload crash/hang dumps (on failure) if: ${{ failure() }} @@ -102,8 +103,8 @@ jobs: with: name: FailedTestOutput-${{ matrix.os }} path: | - ${{ github.workspace }}/TestOutput/**/*.dmp - ${{ github.workspace }}/TestOutput/**/Sequence_*.xml + ${{ env.TEST_OUTPUT_DIRECTORY }}/*.dmp + ${{ env.TEST_OUTPUT_DIRECTORY }}/Sequence_*.xml if-no-files-found: ignore - name: Report test results @@ -112,14 +113,15 @@ jobs: with: name: ${{ matrix.os }} test results reporter: dotnet-trx - path: '**/*.trx' + path: '${{ env.TEST_OUTPUT_DIRECTORY }}/*.trx' + path-replace-backslashes: true fail-on-empty: 'true' fail-on-error: 'false' - name: Generate code coverage report uses: danielpalme/ReportGenerator-GitHub-Action@v5 with: - reports: '**/coverage.opencover.xml' + reports: '${{ env.TEST_OUTPUT_DIRECTORY }}/*cobertura.xml' targetdir: 'coveragereport' reporttypes: 'MarkdownAssembliesSummary;MarkdownSummaryGithub' filefilters: '-*.g.cs' diff --git a/.github/workflows/component-shared-workflow.yml b/.github/workflows/component-shared-workflow.yml index 52ca149a42..1df0267540 100644 --- a/.github/workflows/component-shared-workflow.yml +++ b/.github/workflows/component-shared-workflow.yml @@ -23,9 +23,10 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: true SOLUTION_FILE: 'src/Steeltoe.${{ inputs.component }}.slnf' + TEST_OUTPUT_DIRECTORY: '${{ github.workspace }}/TestOutput' 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 1m + --no-build --no-progress --configuration Release --results-directory '${{ github.workspace }}/TestOutput' + --report-trx --coverage --coverage-settings coverage.config --crashdump --hangdump --hangdump-timeout 1m jobs: build: @@ -81,11 +82,11 @@ jobs: run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal - name: Test - run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} + run: dotnet test --solution ${{ env.SOLUTION_FILE }} --filter-not-trait "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Test (memory dumps) if: ${{ inputs.component == 'Management' }} - run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} + run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter-trait "Category=MemoryDumps" ${{ env.COMMON_TEST_ARGS }} - name: Upload crash/hang dumps (on failure) if: ${{ failure() }} @@ -93,8 +94,8 @@ jobs: with: name: FailedTestOutput-${{ inputs.OS }}-latest path: | - ${{ github.workspace }}/TestOutput/**/*.dmp - ${{ github.workspace }}/TestOutput/**/Sequence_*.xml + ${{ env.TEST_OUTPUT_DIRECTORY }}/*.dmp + ${{ env.TEST_OUTPUT_DIRECTORY }}/Sequence_*.xml if-no-files-found: ignore - name: Report test results @@ -103,6 +104,7 @@ jobs: with: name: ${{ inputs.OS }}-latest test results reporter: dotnet-trx - path: '**/*.trx' + path: '${{ env.TEST_OUTPUT_DIRECTORY }}/*.trx' + path-replace-backslashes: true fail-on-empty: 'true' fail-on-error: 'false' diff --git a/.github/workflows/sonarcube.yml b/.github/workflows/sonarcube.yml index c336b6e073..33bae61c5a 100644 --- a/.github/workflows/sonarcube.yml +++ b/.github/workflows/sonarcube.yml @@ -22,9 +22,10 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 DOTNET_NOLOGO: true SOLUTION_FILE: 'src/Steeltoe.All.sln' + TEST_OUTPUT_DIRECTORY: '${{ github.workspace }}/TestOutput' SONAR_TEST_ARGS: >- - --no-build --configuration Release --collect "XPlat Code Coverage" --logger trx --results-directory ${{ github.workspace }}/TestOutput - --settings coverlet.runsettings -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.UseSourceLink=false + --no-build --no-progress --configuration Release --results-directory '${{ github.workspace }}/TestOutput' + --report-trx --coverage --coverage-settings coverage.sonar.config jobs: analyze: @@ -75,16 +76,24 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: >- dotnet sonarscanner begin /k:"SteeltoeOSS_steeltoe" /o:"steeltoeoss" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" - /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml + /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths="${{ env.TEST_OUTPUT_DIRECTORY }}/SonarQube.xml" - name: Build solution run: dotnet build ${{ env.SOLUTION_FILE }} --no-restore --configuration Release --verbosity minimal - name: Test - run: dotnet test ${{ env.SOLUTION_FILE }} --filter "Category!=MemoryDumps" ${{ env.SONAR_TEST_ARGS }} + run: dotnet test --solution ${{ env.SOLUTION_FILE }} --filter-not-trait "Category=MemoryDumps" ${{ env.SONAR_TEST_ARGS }} - name: Test (memory dumps) - run: dotnet test src/Management/test/Endpoint.Test --filter "Category=MemoryDumps" ${{ env.SONAR_TEST_ARGS }} + run: dotnet test --project src/Management/test/Endpoint.Test/Steeltoe.Management.Endpoint.Test.csproj --filter-trait "Category=MemoryDumps" ${{ env.SONAR_TEST_ARGS }} + + - name: Convert Cobertura coverage to Sonar format + uses: danielpalme/ReportGenerator-GitHub-Action@v5 + with: + reports: '${{ env.TEST_OUTPUT_DIRECTORY }}/*cobertura.xml' + targetdir: '${{ env.TEST_OUTPUT_DIRECTORY }}' + reporttypes: 'SonarQube' + filefilters: '-*.g.cs' - name: End Sonar .NET scanner if: ${{ !cancelled() && steps.sonar_begin.outcome == 'success' }} diff --git a/coverage.config b/coverage.config new file mode 100644 index 0000000000..9210688ee0 --- /dev/null +++ b/coverage.config @@ -0,0 +1,29 @@ + + + + cobertura + true + + + + .*ConfigurationSchemaGenerator.* + + + + + ^System\.ObsoleteAttribute$ + ^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$ + ^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$ + ^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$ + + + + + .*\\test\\.* + + + + diff --git a/coverage.sonar.config b/coverage.sonar.config new file mode 100644 index 0000000000..eb0f0fb869 --- /dev/null +++ b/coverage.sonar.config @@ -0,0 +1,32 @@ + + + + cobertura + + + + + .*ConfigurationSchemaGenerator.* + + + + + ^System\.ObsoleteAttribute$ + ^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$ + ^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$ + ^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$ + + + + + .*\\test\\.* + + + + diff --git a/coverlet.runsettings b/coverlet.runsettings deleted file mode 100644 index fe0adb82b8..0000000000 --- a/coverlet.runsettings +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - opencover - [ConfigurationSchemaGenerator]* - **/test/**/*.* - ObsoleteAttribute,GeneratedCodeAttribute,CompilerGeneratedAttribute - true - - - - - diff --git a/global.json b/global.json new file mode 100644 index 0000000000..3140116df3 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/nuget.config b/nuget.config index 128d95e590..94d8574860 100644 --- a/nuget.config +++ b/nuget.config @@ -3,10 +3,6 @@ + - - - - - diff --git a/shared-test.props b/shared-test.props index 120065dd28..58c1999cb1 100644 --- a/shared-test.props +++ b/shared-test.props @@ -5,20 +5,27 @@ $(NoWarn);S2094;S3717;SA1602;CA1062;CA1707;NU5104 + + true + + $(NoWarn);NU3018;NU3027;NU3042 + + - - + + + + - - + diff --git a/src/Connectors/test/Connectors.Test/Steeltoe.Connectors.Test.csproj b/src/Connectors/test/Connectors.Test/Steeltoe.Connectors.Test.csproj index bf2405d3f8..4002d54b0e 100644 --- a/src/Connectors/test/Connectors.Test/Steeltoe.Connectors.Test.csproj +++ b/src/Connectors/test/Connectors.Test/Steeltoe.Connectors.Test.csproj @@ -14,6 +14,7 @@ + diff --git a/src/Management/src/Endpoint/Actuators/Health/Contributors/FileSystem/NetworkShareWrapper.cs b/src/Management/src/Endpoint/Actuators/Health/Contributors/FileSystem/NetworkShareWrapper.cs index a62227d27d..c39452957d 100644 --- a/src/Management/src/Endpoint/Actuators/Health/Contributors/FileSystem/NetworkShareWrapper.cs +++ b/src/Management/src/Endpoint/Actuators/Health/Contributors/FileSystem/NetworkShareWrapper.cs @@ -2,7 +2,6 @@ // 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 System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace Steeltoe.Management.Endpoint.Actuators.Health.Contributors.FileSystem; @@ -27,7 +26,6 @@ private NetworkShareWrapper(ulong freeBytesAvailable, ulong totalNumberOfBytes) : null; } - [ExcludeFromCodeCoverage(Justification = "Workaround for https://github.com/coverlet-coverage/coverlet/issues/1762")] private static partial class NativeMethods { [LibraryImport("kernel32.dll", EntryPoint = "GetDiskFreeSpaceExW", StringMarshalling = StringMarshalling.Utf16, SetLastError = true)] diff --git a/src/Steeltoe.All.sln b/src/Steeltoe.All.sln index 43d8724a28..61e38a2678 100644 --- a/src/Steeltoe.All.sln +++ b/src/Steeltoe.All.sln @@ -29,7 +29,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_shared", "_shared", "{DC1B ..\.gitattributes = ..\.gitattributes ..\.gitignore = ..\.gitignore ..\cleanupcode.ps1 = ..\cleanupcode.ps1 - ..\coverlet.runsettings = ..\coverlet.runsettings + ..\coverage.config = ..\coverage.config + ..\coverage.sonar.config = ..\coverage.sonar.config ..\Directory.Build.targets = ..\Directory.Build.targets ..\nuget.config = ..\nuget.config ..\PackageReadme.md = ..\PackageReadme.md diff --git a/versions.props b/versions.props index 20d9d10375..5af6dfaca7 100644 --- a/versions.props +++ b/versions.props @@ -6,10 +6,12 @@ --> 9.0.* - 6.0.* 7.2.* 3.54.* 4.14.* + + 18.3.0-preview.25611.1 + 2.1.0-preview.25611.7 6.1.* 7.0.* 3.5.* @@ -26,9 +28,7 @@ 2.0.* 8.14.* 4.9.* - 18.0.* 3.2.* - 3.1.* From 89de4feb44f48e741f1f0a6b3a24fb60bdbc108f 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 2/7] 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 08236cb468cbf78fbe6e11a790174aaca9b68fc9 Mon Sep 17 00:00:00 2001 From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:16:30 +0100 Subject: [PATCH 3/7] Revert "TEST: Add new tests to verify coverage diff" This reverts commit e853c12e44bf2ce7d12c5ad8528fae1304476ed5. --- 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 093670ef182fcba7e60f77e24c907ff8c69edd9c 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 4/7] 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 abb27133ba28aee0acc2aa85634b91871f37ac47 Mon Sep 17 00:00:00 2001 From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:17:20 +0100 Subject: [PATCH 5/7] Revert "TEST: Add test that crashes with StackOverflowException" This reverts commit 5623dba360f0e1e66b1d1c7b23f585ffe299fa09. --- .../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 9d70e84b40c1a820ce1510e7b0540d8c557587ff 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 6/7] 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 fbaed295c755cd27d9e9159957fb4f423971b113 Mon Sep 17 00:00:00 2001 From: Bart Koelman <104792814+bart-vmware@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:17:54 +0100 Subject: [PATCH 7/7] Revert "TEST: Add test that never completes" This reverts commit 0eac4125ebf4a807bd2825e508bfe11ab8d6fcf0. --- .../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) - { - ; - } - } -}