Skip to content

Commit

Permalink
test: Unit Test TFM update, Integration Test workflow dependency upda…
Browse files Browse the repository at this point in the history
…te (#2758)
  • Loading branch information
tippmar-nr committed Sep 13, 2024
1 parent 89ad7dd commit 5835ab2
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
54 changes: 37 additions & 17 deletions .github/workflows/all_solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Agent/Benchmarking/Benchmarking/Benchmarking.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net481</TargetFrameworks>
<AssemblyName>Benchmarking</AssemblyName>
<RootNamespace>Benchmarking</RootNamespace>
<Description></Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net481</TargetFrameworks>
<RootNamespace>BenchmarkingTests</RootNamespace>
<AssemblyName>NewRelic.Agent.Core.BenchmarkingTests</AssemblyName>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
Expand All @@ -13,7 +13,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="MoreLinq" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net481</TargetFrameworks>
<AssemblyName>ConcurrentBenchmarking</AssemblyName>
<RootNamespace>ConcurrentBenchmarking</RootNamespace>
<Description></Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<RootNamespace>NewRelic.Agent.IntegrationTests</RootNamespace>
<AssemblyName>NewRelic.Agent.IntegrationTests</AssemblyName>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net481'">
<PublishIEDriver>true</PublishIEDriver>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -55,12 +55,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<RootNamespace>NewRelic.Agent.UnboundedIntegrationTests</RootNamespace>
<AssemblyName>NewRelic.Agent.UnboundedIntegrationTests</AssemblyName>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net481</TargetFrameworks>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<RootNamespace>NewRelic.Agent.Tests.TestSerializationHelpers.Tests</RootNamespace>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions tests/Agent/UnitTests/AsyncLocalTests/AsyncLocalTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462</TargetFrameworks>
<TargetFrameworks>net481</TargetFrameworks>
<RootNamespace>NewRelic.Providers.CallStack.AsyncLocalTests</RootNamespace>
<AssemblyName>NewRelic.Providers.CallStack.AsyncLocalTests</AssemblyName>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
Expand All @@ -12,7 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
Expand Down
6 changes: 3 additions & 3 deletions tests/Agent/UnitTests/CompositeTests/CompositeTests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<RootNamespace>CompositeTests</RootNamespace>
<AssemblyName>NewRelic.Agent.Core.CompositeTests</AssemblyName>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
Expand All @@ -11,7 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MoreLinq" Version="2.4.0" />
Expand All @@ -29,7 +29,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
9 changes: 5 additions & 4 deletions tests/Agent/UnitTests/Core.UnitTest/Core.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<RootNamespace>NewRelic.Agent.Core</RootNamespace>
<AssemblyName>NewRelic.Agent.Core.UnitTest</AssemblyName>
<DebugType>Full</DebugType>
Expand All @@ -11,7 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MoreLinq" Version="2.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand All @@ -28,12 +28,13 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net80'">
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Messaging" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
Expand All @@ -46,7 +47,7 @@
<ProjectReference Include="..\..\NewRelic.Testing.Assertions\NewRelic.Testing.Assertions.csproj" />
<ProjectReference Include="..\NewRelic.Agent.TestUtilities\NewRelic.Agent.TestUtilities.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<ProjectReference Include="$(RootProjectDirectory)\src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\AspNet\AspNet.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void AttemptAutoStart_SchedulesConnectAsynchronously_IfAutoStartIsOnAndSy
}
}


[Test]
[TestCase("ForceRestartException")]
[TestCase("HttpException")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<RootNamespace>Agent.Extensions.Tests</RootNamespace>
<AssemblyName>NewRelic.Agent.Extensions.Tests</AssemblyName>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp1.0'">Full</DebugType>
Expand All @@ -11,7 +11,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
Expand All @@ -25,7 +25,7 @@
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<TargetFrameworks>net481;net8.0</TargetFrameworks>
<RootNamespace>NewRelic.Agent.TestUtilities</RootNamespace>
<AssemblyName>NewRelic.Agent.TestUtilities</AssemblyName>
</PropertyGroup>
Expand All @@ -21,7 +21,7 @@
<ItemGroup>
<ProjectReference Include="$(RootProjectDirectory)\src\Agent\NewRelic\Agent\Core\Core.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{A6AE0190-AEAB-4B3A-B671-95C2D5123BF9}</ProjectGuid>
<TargetFramework>net462</TargetFramework>
<TargetFramework>net481</TargetFramework>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AssemblyTitle>NewRelic.Testing.Assertions.UnitTests</AssemblyTitle>
<Product>NewRelic.Testing.Assertions.UnitTests</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JustMock" Version="2023.3.1122.188" />
<PackageReference Include="JustMock" Version="2024.3.805.336" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MoreLinq" Version="2.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down

0 comments on commit 5835ab2

Please sign in to comment.