From 5835ab23d674ae79b5239874e9d9915c903d085f Mon Sep 17 00:00:00 2001 From: Marty T <120425148+tippmar-nr@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:47:27 -0500 Subject: [PATCH] test: Unit Test TFM update, Integration Test workflow dependency update (#2758) --- .github/dependabot.yml | 2 +- .github/workflows/all_solutions.yml | 54 +++++++++++++------ .../Benchmarking/Benchmarking.csproj | 2 +- .../BenchmarkingTests.csproj | 4 +- .../ConcurrentBenchmarking.csproj | 2 +- .../IntegrationTests/IntegrationTests.csproj | 8 +-- .../UnboundedIntegrationTests.csproj | 2 +- .../NewRelic.Testing.Assertions.csproj | 2 +- .../TestSerializationHelpers.Test.csproj | 2 +- .../AsyncLocalTests/AsyncLocalTests.csproj | 4 +- .../CompositeTests/CompositeTests.csproj | 6 +-- .../Core.UnitTest/Core.UnitTest.csproj | 9 ++-- .../DataTransport/ConnectionManagerTests.cs | 1 - .../NewRelic.Agent.Extensions.Tests.csproj | 6 +-- .../NewRelic.Agent.TestUtilities.csproj | 4 +- ...wRelic.Testing.Assertions.UnitTests.csproj | 2 +- .../PublicApiChangeTests.csproj | 2 +- 17 files changed, 67 insertions(+), 45 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4d410ca096..08fb886c80 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -37,7 +37,7 @@ updates: - "*" allow: - dependency-name: "coverlet.collector" - - dependency-name: "JustMock" # until we upgrade unit tests to target 4.8.1, we can' upgrade to the 20204 JustMock release + - dependency-name: "JustMock" - dependency-name: "Microsoft.NET.Test.Sdk" - dependency-name: "Microsoft.VisualStudio.Azure.Containers.Tools.Targets" - dependency-name: "Microsoft.VisualStudio.Threading.Analyzers" diff --git a/.github/workflows/all_solutions.yml b/.github/workflows/all_solutions.yml index 4e85fffeb8..91b5ffcc09 100644 --- a/.github/workflows/all_solutions.yml +++ b/.github/workflows/all_solutions.yml @@ -276,7 +276,7 @@ jobs: env: integration_tests_shared_project: ${{ github.workspace }}/tests/Agent/IntegrationTests/Shared - integration_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/IntegrationTests/bin/Release/net462 + integration_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/IntegrationTests/bin/Release/net481 # Make this variable true to enable extra data-gathering and logging to help troubleshoot test failures, at the cost of additional time and resources enhanced_logging: false NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1 @@ -327,9 +327,24 @@ jobs: name: integrationtests # Should not need a path because the integration test artifacts are archived with the full directory structure - - name: Install dependencies + - name: Install HostableWebCore Feature + if: | # only install for the required namespaces + matrix.namespace == 'AgentFeatures' || matrix.namespace == 'AgentLogs' || matrix.namespace == 'AgentMetrics' || matrix.namespace == 'BasicInstrumentation' || + matrix.namespace == 'CatInbound' || matrix.namespace == 'CatOutbound' || matrix.namespace == 'CodeLevelMetrics' || matrix.namespace == 'CSP' || + matrix.namespace == 'CustomAttributes' || matrix.namespace == 'CustomInstrumentation' || matrix.namespace == 'DataTransmission' || + matrix.namespace == 'DistributedTracing' || matrix.namespace == 'Errors' || matrix.namespace == 'HttpClientInstrumentation' || + matrix.namespace == 'Rejit.NetFramework' || matrix.namespace == 'RequestHandling' || matrix.namespace == 'RequestHeadersCapture.AspNet' || + matrix.namespace == 'RequestHeadersCapture.AspNetCore' || matrix.namespace == 'RequestHeadersCapture.EnvironmentVariables' || + matrix.namespace == 'RequestHeadersCapture.WCF' || matrix.namespace == 'WCF.Client.IIS.ASPDisabled' || + matrix.namespace == 'WCF.Client.IIS.ASPEnabled' || matrix.namespace == 'WCF.Service.IIS.ASPDisabled' || + matrix.namespace == 'WCF.Service.IIS.ASPEnabled' run: | Enable-WindowsOptionalFeature -Online -FeatureName IIS-HostableWebCore + shell: powershell + + - name: Install aiohttp + if: matrix.namespace == 'DistributedTracing' + run: | pip install aiohttp shell: powershell @@ -406,7 +421,7 @@ jobs: env: integration_tests_shared_project: ${{ github.workspace }}/tests/Agent/IntegrationTests/Shared - unbounded_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/UnboundedIntegrationTests/bin/Release/net462 + unbounded_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/UnboundedIntegrationTests/bin/Release/net481 NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1 # Make this variable true to enable extra data-gathering and logging to help troubleshoot test failures, at the cost of additional time and resources enhanced_logging: false @@ -443,23 +458,28 @@ jobs: New-ItemProperty -Path $registryPath -Name "Enabled" -Value "0" -PropertyType DWORD -Force shell: powershell - - name: Install dependencies + - name: Install HostableWebCore Feature + if: | # only install for the required namespaces + matrix.namespace == 'Couchbase' || matrix.namespace == 'MongoDB' || matrix.namespace == 'MsSql' || matrix.namespace == 'Oracle' run: | - Write-Host "Installing HostableWebCore Feature" Enable-WindowsOptionalFeature -Online -FeatureName IIS-HostableWebCore - - if ("${{ matrix.namespace }}" -eq "Msmq") { - Write-Host "Installing Msmq Features" - Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All - Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-HTTP -All - Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Triggers -All - } + shell: powershell - if ("${{ matrix.namespace }}" -eq "MsSql") { - Write-Host "Installing MSSQL CLI" - msiexec /i "${{ github.workspace }}\build\Tools\sqlncli.msi" IACCEPTSQLNCLILICENSETERMS=YES /quiet /qn /norestart - Start-Sleep 20 # Need to wait for install to finish -- takes only a few seconds, but we need to be sure. - } + - name: Install MSMQ dependencies + if: matrix.namespace == 'Msmq' + run: | + Write-Host "Installing Msmq Features" + Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All + Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-HTTP -All + Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Triggers -All + shell: powershell + + - name: Install MsSql dependencies + if: matrix.namespace == 'MsSql' + run: | + Write-Host "Installing MSSQL CLI" + msiexec /i "${{ github.workspace }}\build\Tools\sqlncli.msi" IACCEPTSQLNCLILICENSETERMS=YES /quiet /qn /norestart + Start-Sleep 20 # Need to wait for install to finish -- takes only a few seconds, but we need to be sure. shell: powershell - name: Set up secrets diff --git a/tests/Agent/Benchmarking/Benchmarking/Benchmarking.csproj b/tests/Agent/Benchmarking/Benchmarking/Benchmarking.csproj index b8e9e5b4ac..3c0538702a 100644 --- a/tests/Agent/Benchmarking/Benchmarking/Benchmarking.csproj +++ b/tests/Agent/Benchmarking/Benchmarking/Benchmarking.csproj @@ -1,6 +1,6 @@ - net462 + net481 Benchmarking Benchmarking diff --git a/tests/Agent/Benchmarking/BenchmarkingTests/BenchmarkingTests.csproj b/tests/Agent/Benchmarking/BenchmarkingTests/BenchmarkingTests.csproj index 16a96d31a0..cf78b2923c 100644 --- a/tests/Agent/Benchmarking/BenchmarkingTests/BenchmarkingTests.csproj +++ b/tests/Agent/Benchmarking/BenchmarkingTests/BenchmarkingTests.csproj @@ -1,6 +1,6 @@ - net462 + net481 BenchmarkingTests NewRelic.Agent.Core.BenchmarkingTests Full @@ -13,7 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/Agent/Benchmarking/ConcurrentBenchmarking/ConcurrentBenchmarking.csproj b/tests/Agent/Benchmarking/ConcurrentBenchmarking/ConcurrentBenchmarking.csproj index 60b4973495..32abd50a1a 100644 --- a/tests/Agent/Benchmarking/ConcurrentBenchmarking/ConcurrentBenchmarking.csproj +++ b/tests/Agent/Benchmarking/ConcurrentBenchmarking/ConcurrentBenchmarking.csproj @@ -1,6 +1,6 @@ - net462 + net481 ConcurrentBenchmarking ConcurrentBenchmarking diff --git a/tests/Agent/IntegrationTests/IntegrationTests/IntegrationTests.csproj b/tests/Agent/IntegrationTests/IntegrationTests/IntegrationTests.csproj index c56635fb50..00850a046d 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/IntegrationTests.csproj +++ b/tests/Agent/IntegrationTests/IntegrationTests/IntegrationTests.csproj @@ -2,9 +2,9 @@ NewRelic.Agent.IntegrationTests NewRelic.Agent.IntegrationTests - net462;net8.0 + net481;net8.0 - + true @@ -55,12 +55,14 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + + + diff --git a/tests/Agent/IntegrationTests/UnboundedIntegrationTests/UnboundedIntegrationTests.csproj b/tests/Agent/IntegrationTests/UnboundedIntegrationTests/UnboundedIntegrationTests.csproj index 8448342933..97828d7c21 100644 --- a/tests/Agent/IntegrationTests/UnboundedIntegrationTests/UnboundedIntegrationTests.csproj +++ b/tests/Agent/IntegrationTests/UnboundedIntegrationTests/UnboundedIntegrationTests.csproj @@ -2,7 +2,7 @@ NewRelic.Agent.UnboundedIntegrationTests NewRelic.Agent.UnboundedIntegrationTests - net462 + net481 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages diff --git a/tests/Agent/NewRelic.Testing.Assertions/NewRelic.Testing.Assertions.csproj b/tests/Agent/NewRelic.Testing.Assertions/NewRelic.Testing.Assertions.csproj index 1ddfc9a15b..1ca4549f2f 100644 --- a/tests/Agent/NewRelic.Testing.Assertions/NewRelic.Testing.Assertions.csproj +++ b/tests/Agent/NewRelic.Testing.Assertions/NewRelic.Testing.Assertions.csproj @@ -1,6 +1,6 @@ - net462;net8.0 + net481;net8.0 diff --git a/tests/Agent/Shared/TestSerializationHelpers.Test/TestSerializationHelpers.Test.csproj b/tests/Agent/Shared/TestSerializationHelpers.Test/TestSerializationHelpers.Test.csproj index 6e376c0133..536d1c1169 100644 --- a/tests/Agent/Shared/TestSerializationHelpers.Test/TestSerializationHelpers.Test.csproj +++ b/tests/Agent/Shared/TestSerializationHelpers.Test/TestSerializationHelpers.Test.csproj @@ -1,7 +1,7 @@ - net462;net8.0 + net481;net8.0 NewRelic.Agent.Tests.TestSerializationHelpers.Tests diff --git a/tests/Agent/UnitTests/AsyncLocalTests/AsyncLocalTests.csproj b/tests/Agent/UnitTests/AsyncLocalTests/AsyncLocalTests.csproj index d0ee668726..f81d9fb6a7 100644 --- a/tests/Agent/UnitTests/AsyncLocalTests/AsyncLocalTests.csproj +++ b/tests/Agent/UnitTests/AsyncLocalTests/AsyncLocalTests.csproj @@ -1,6 +1,6 @@ - net462 + net481 NewRelic.Providers.CallStack.AsyncLocalTests NewRelic.Providers.CallStack.AsyncLocalTests Full @@ -12,7 +12,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/Agent/UnitTests/CompositeTests/CompositeTests.csproj b/tests/Agent/UnitTests/CompositeTests/CompositeTests.csproj index d5dc5e2ea6..bc8eeddd63 100644 --- a/tests/Agent/UnitTests/CompositeTests/CompositeTests.csproj +++ b/tests/Agent/UnitTests/CompositeTests/CompositeTests.csproj @@ -1,6 +1,6 @@ - net462;net8.0 + net481;net8.0 CompositeTests NewRelic.Agent.Core.CompositeTests Full @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -29,7 +29,7 @@ - + diff --git a/tests/Agent/UnitTests/Core.UnitTest/Core.UnitTest.csproj b/tests/Agent/UnitTests/Core.UnitTest/Core.UnitTest.csproj index 99c61a5137..5d2b513605 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/Core.UnitTest.csproj +++ b/tests/Agent/UnitTests/Core.UnitTest/Core.UnitTest.csproj @@ -1,6 +1,6 @@ - net462;net8.0 + net481;net8.0 NewRelic.Agent.Core NewRelic.Agent.Core.UnitTest Full @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -28,12 +28,13 @@ - + + @@ -46,7 +47,7 @@ - + diff --git a/tests/Agent/UnitTests/Core.UnitTest/DataTransport/ConnectionManagerTests.cs b/tests/Agent/UnitTests/Core.UnitTest/DataTransport/ConnectionManagerTests.cs index f4415eae4f..289e6028da 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/DataTransport/ConnectionManagerTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/DataTransport/ConnectionManagerTests.cs @@ -81,7 +81,6 @@ public void AttemptAutoStart_SchedulesConnectAsynchronously_IfAutoStartIsOnAndSy } } - [Test] [TestCase("ForceRestartException")] [TestCase("HttpException")] diff --git a/tests/Agent/UnitTests/NewRelic.Agent.Extensions.Tests/NewRelic.Agent.Extensions.Tests.csproj b/tests/Agent/UnitTests/NewRelic.Agent.Extensions.Tests/NewRelic.Agent.Extensions.Tests.csproj index fcfc5291e5..3d02556477 100644 --- a/tests/Agent/UnitTests/NewRelic.Agent.Extensions.Tests/NewRelic.Agent.Extensions.Tests.csproj +++ b/tests/Agent/UnitTests/NewRelic.Agent.Extensions.Tests/NewRelic.Agent.Extensions.Tests.csproj @@ -1,6 +1,6 @@ - net462;net8.0 + net481;net8.0 Agent.Extensions.Tests NewRelic.Agent.Extensions.Tests Full @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -25,7 +25,7 @@ - + diff --git a/tests/Agent/UnitTests/NewRelic.Agent.TestUtilities/NewRelic.Agent.TestUtilities.csproj b/tests/Agent/UnitTests/NewRelic.Agent.TestUtilities/NewRelic.Agent.TestUtilities.csproj index 01a1764dbd..0b4fbc431a 100644 --- a/tests/Agent/UnitTests/NewRelic.Agent.TestUtilities/NewRelic.Agent.TestUtilities.csproj +++ b/tests/Agent/UnitTests/NewRelic.Agent.TestUtilities/NewRelic.Agent.TestUtilities.csproj @@ -1,6 +1,6 @@ - net462;net8.0 + net481;net8.0 NewRelic.Agent.TestUtilities NewRelic.Agent.TestUtilities @@ -21,7 +21,7 @@ - + diff --git a/tests/Agent/UnitTests/NewRelic.Testing.Assertions.UnitTests/NewRelic.Testing.Assertions.UnitTests.csproj b/tests/Agent/UnitTests/NewRelic.Testing.Assertions.UnitTests/NewRelic.Testing.Assertions.UnitTests.csproj index 4cdaa4afb3..f1c48888ce 100644 --- a/tests/Agent/UnitTests/NewRelic.Testing.Assertions.UnitTests/NewRelic.Testing.Assertions.UnitTests.csproj +++ b/tests/Agent/UnitTests/NewRelic.Testing.Assertions.UnitTests/NewRelic.Testing.Assertions.UnitTests.csproj @@ -2,7 +2,7 @@ x86 {A6AE0190-AEAB-4B3A-B671-95C2D5123BF9} - net462 + net481 {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} NewRelic.Testing.Assertions.UnitTests NewRelic.Testing.Assertions.UnitTests diff --git a/tests/Agent/UnitTests/PublicApiChangeTests/PublicApiChangeTests.csproj b/tests/Agent/UnitTests/PublicApiChangeTests/PublicApiChangeTests.csproj index 5fafcac760..f92e905c9d 100644 --- a/tests/Agent/UnitTests/PublicApiChangeTests/PublicApiChangeTests.csproj +++ b/tests/Agent/UnitTests/PublicApiChangeTests/PublicApiChangeTests.csproj @@ -16,7 +16,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - +