You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Update agent development and integration testing documentation (#3063)
* WIP
* Fix profiler build and local testing documentation
Also fix issue with linux profiler build docker-compose file where it would bomb out if a certain env var wasn't set, for a debug version of the profiler that isn't really relevant most of the time.
* Update docs/integration-tests.md
Co-authored-by: Marty T <[email protected]>
* Add a note for extra clarity
---------
Co-authored-by: Marty T <[email protected]>
Co-authored-by: Chris Ventura <[email protected]>
Copy file name to clipboardExpand all lines: docs/development.md
+23-5
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Development
2
2
3
3
## Requirements
4
-
*[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
4
+
*[Visual Studio 2022](https://visualstudio.microsoft.com/downloads/)
5
5
* Workloads
6
6
* .NET desktop development
7
7
* Desktop development with C++
8
8
* Individual components
9
9
* C++ ATL for v142 build tools (x86 & x64)
10
10
* Optional installs:
11
-
*[Docker Desktop for Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows/) for building the native Linux binaries.
12
-
*[WiX Toolset 3.11](https://wixtoolset.org/releases/)and the WiX Toolset Visual Studio 2019 Extension for building the Windows MSI installer.
11
+
*[Docker Desktop for Windows](https://docs.docker.com/desktop/setup/install/windows-install/) for building the native Linux binaries, as well as running containerized integration tests.
12
+
*[HeatWave](https://www.firegiant.com/heatwave/)is a Visual Studio extension that enables building the [agent MSI installer solution](../src/Agent/MsiInstaller/MsiInstaller.sln).
13
13
14
14
## Building
15
15
@@ -26,6 +26,7 @@ To get started quickly, this is the only solution you need to build. Building th
26
26
| .NET Core | Windows | x64 | src/Agent/newrelichome_x64_coreclr |
27
27
| .NET Core | Windows | x86 | src/Agent/newrelichome_x86_coreclr |
28
28
| .NET Core | Linux | x64 | src/Agent/newrelichome_x64_coreclr_linux |
29
+
| .NET Core | Linux | arm64 | src/Agent/newrelichome_arm64_coreclr_linux |
29
30
30
31
These home directories can be used to run and test the agent in your development environment.
The Profiler.sln builds the native profiler component of the .NET agent. The profiler implements interfaces defined by the unmanaged [.NET Profiling API](https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/) that enable the agent to attach to and monitor a .NET process.
55
+
The Profiler.sln builds the native profiler component of the .NET agent. The profiler implements interfaces defined by the unmanaged [.NET Profiling API](https://docs.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/) that enable the agent to attach to and monitor a .NET process. See [the profiler README](../src/Agent/NewRelic/Profiler/README.md) for more details.
55
56
56
-
As mentioned above, this solution does not need to be built if you will only be working with the agent's managed C# code. Pre-built versions of the profiler for both Windows (x86 and x64) and Linux (x64) are checked into the repository (src/Agent/_profilerBuild) and are used for creating the home directories built by the FullAgent.sln. These pre-built versions are for development purposes only, and should be updated if you do work on the profiler.
57
+
As mentioned above, this solution does not need to be built if you will only be working with the agent's managed C# code. The profiler is [available as a NuGet package](https://www.nuget.org/packages/NewRelic.Agent.Internal.Profiler) and is referenced by the full agent solution from NuGet [here](https://github.com/newrelic/newrelic-dotnet-agent/blob/1f446c282811a0f2ccd71a088b35397a29d961a0/src/Agent/NewRelic/Home/Home.csproj#L16).
57
58
58
59
You can use a Powershell [script](../src/Agent/NewRelic/Profiler/build/build.ps1) to build the profiler.
59
60
@@ -78,6 +79,23 @@ build.ps1 -Platform linux
78
79
build.ps1
79
80
```
80
81
82
+
#### Local profiler testing
83
+
84
+
In order to integrate local profiler changes with local builds of the FullAgent solution:
85
+
86
+
1. First, build the FullAgent solution from Visual Studio (creating the various agent home dirs in `src/Agent`).
87
+
2. Build the profiler for all platforms and architectures: `build.ps1` (which places the profiler artifacts in `src/Agent/_profilerBuild`)
88
+
3. Copy the relevant profiler .dll (Windows) or .so (Linux) to the appropriate agent home folder on your system, overwriting the version pulled from NuGet:
89
+
```
90
+
# Example shown for the Windows 64-bit profiler, testing with the Windows CoreCLR (.NET Core/.NET) version of the agent
Note that if you rebuild the agent solution after copying locally-build profiler files to the agent home dirs, the profiler files will be overwritten with the NuGet package version, and you'll need to copy the local profile files to the home dirs again.
98
+
81
99
## Testing
82
100
83
101
* Unit tests use the NUnit framework and are contained in the solutions. Run them using the Visual Studio Test Explorer.
Copy file name to clipboardExpand all lines: docs/integration-tests.md
+10-21
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ These tests execute against valid New Relic accounts and test a variety of featu
8
8
9
9
## Testing on Windows with Visual Studio
10
10
11
-
Visual Studio 2022 or greater preferred.
11
+
Visual Studio 2022 or greater required.
12
12
13
-
Visual Studio 2019 may work with .NET 6 additionally installed.
13
+
All generally available and supported .NET runtimes should be installed (e.g. .NET 8 and .NET 9 as of March 2025)
14
14
15
15
### Additional install requirements
16
16
@@ -22,8 +22,8 @@ Install the "ASP.NET and web development" workload in the "Web & Cloud" category
22
22
23
23
Depending on which version of Visual Studio you are using, you may have to install some or all of the following:
24
24
25
-
* .NET 6
26
-
* .NET 7
25
+
* .NET 8
26
+
* .NET 9
27
27
* .NET Framework 4.7.1 targeting pack
28
28
* .NET Framework 4.8.0 targeting pack
29
29
* .NET Framework 4.8.1 targeting pack
@@ -196,7 +196,7 @@ See the test secrets section above on configuring an appropriate account.
196
196
197
197
#### Selenium tests
198
198
199
-
We currently have one test that executes a JavaScript ajax request via Selenium. This requires Internet Explorer to be installed and does not yet work with Edge.
199
+
We currently have one test that executes a JavaScript ajax request via Selenium. This requires Chrome to be installed.
See Microsoft's documentation for how to install the required SDKs for your particular Linux distro and hardware platform: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual
276
265
277
266
### Set up test secrets
278
267
@@ -285,12 +274,12 @@ Refer to the section above in the Windows setup instructions regarding configuri
285
274
As previously mentioned, the agent solution needs to be built on Windows. If you are using an Ubuntu VM in WSL, you can use this workflow to run the agent integration tests on Linux:
286
275
287
276
1. Build the FullAgent.sln in Visual Studio.
288
-
2. Copy the agent repo to the Ubuntu VM. The VM's filesystem can be accessed from the Windows host using this path: `\\wsl$\Ubuntu-20.04` (replace `Ubuntu-20.04` with the name of your VM if it's different).
277
+
2. Copy the agent repo to the Ubuntu VM. The VM's filesystem can be accessed from the Windows host using this path: `\\wsl$\Ubuntu-24.04` (replace `Ubuntu-24.04` with the name of your VM if it's different).
289
278
3. In the VM, from the shell:
290
279
291
280
```
292
281
cd {DOTNET_AGENT_REPO_PATH}/tests/Agent/IntegrationTests/IntegrationTests
293
-
sudo dotnet test -f netcoreapp3.1 -c Release --filter RuntimeFramework=NetCore
282
+
sudo dotnet test -f net9.0 -c Release --filter RuntimeFramework=NetCore
294
283
```
295
284
296
285
For more details on how to use dotnet test, see https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test.
0 commit comments