From 4d31fa15d03f154bcf34e6f86cdfbbbc77473ac5 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Sun, 9 Feb 2025 20:26:23 +0100 Subject: [PATCH 1/2] add information tracing in adapter --- docs/articles/vs-test-adapter/Debugging.md | 20 ++- docs/snippets/Snippets.sln | 1 + docs/snippets/naming.runsettings | 144 +++++++++++++++++++++ 3 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 docs/snippets/naming.runsettings diff --git a/docs/articles/vs-test-adapter/Debugging.md b/docs/articles/vs-test-adapter/Debugging.md index 591f59ae7..8794e83e7 100644 --- a/docs/articles/vs-test-adapter/Debugging.md +++ b/docs/articles/vs-test-adapter/Debugging.md @@ -1,5 +1,22 @@ # Debugging the NUnit3TestAdapter +## Enable Tracing + +Before debugging the adapter, check the trace outputs, which can be enabled using runsettings, either from a file or +the command line. + +Enable the following [features](https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html#dumpxmltestdiscovery-and-dumpxmltestresults): + +```xml + true + true +``` + +This will create a Dump folder under the executing bin directory, containing one file for each setting. These files +include both the input from the testhost and the resulting data returned by the framework/engine. + +## Enabling debugging + Debugging the adapter is done by first creating a debug version of the adapter. You can then enable a debug run by passing one of the NUnit debug settings using runsettings. @@ -19,7 +36,8 @@ From command line, you can set these by adding dotnet test -- NUnit.DebugExecution=true ``` -If you want to do this using Visual Studio, you must add a runsettings file, and add these settings there to the NUnit section. +If you want to do this using Visual Studio, you must add a runsettings file, and add these settings there to the NUnit +section. A detailed explanation of the process can be found in [this blog post](https://hermit.no/debugging-the-nunit3testadapter-take-2/) diff --git a/docs/snippets/Snippets.sln b/docs/snippets/Snippets.sln index 66da5d5f3..72ef0087a 100644 --- a/docs/snippets/Snippets.sln +++ b/docs/snippets/Snippets.sln @@ -7,6 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Snippets.NUnit", "Snippets. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E5F0945-D524-45AB-AF2C-EFEB7B9CDB97}" ProjectSection(SolutionItems) = preProject + naming.runsettings = naming.runsettings nuget.config = nuget.config EndProjectSection EndProject diff --git a/docs/snippets/naming.runsettings b/docs/snippets/naming.runsettings new file mode 100644 index 000000000..7acd66d42 --- /dev/null +++ b/docs/snippets/naming.runsettings @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + false + + + .\TestResults + + + 0 + + + + 10000 + + + false + + + + + + false + false + true + + + 10 + + + + + + + + + + + + + + + + + + + false + true + true + true + true + false + false + + + + + false + + + + + + + + + 0 + + Off + + -1 + 0 + + + {m} + + false + true + false + + + + 1 + true + false + false + Skipped + + Name + + : + Current + + 2000 + false + true + Strict + false + + + + From a753457bff8096bfca4efc9558fe3773bf73a300 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Mon, 10 Feb 2025 21:19:09 +0000 Subject: [PATCH 2/2] auto-fix all linting errors --- docs/articles/vs-test-adapter/Debugging.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/articles/vs-test-adapter/Debugging.md b/docs/articles/vs-test-adapter/Debugging.md index 8794e83e7..0c40587a6 100644 --- a/docs/articles/vs-test-adapter/Debugging.md +++ b/docs/articles/vs-test-adapter/Debugging.md @@ -2,7 +2,7 @@ ## Enable Tracing -Before debugging the adapter, check the trace outputs, which can be enabled using runsettings, either from a file or +Before debugging the adapter, check the trace outputs, which can be enabled using runsettings, either from a file or the command line. Enable the following [features](https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html#dumpxmltestdiscovery-and-dumpxmltestresults): @@ -12,7 +12,7 @@ Enable the following [features](https://docs.nunit.org/articles/vs-test-adapter/ true ``` -This will create a Dump folder under the executing bin directory, containing one file for each setting. These files +This will create a Dump folder under the executing bin directory, containing one file for each setting. These files include both the input from the testhost and the resulting data returned by the framework/engine. ## Enabling debugging @@ -36,7 +36,7 @@ From command line, you can set these by adding dotnet test -- NUnit.DebugExecution=true ``` -If you want to do this using Visual Studio, you must add a runsettings file, and add these settings there to the NUnit +If you want to do this using Visual Studio, you must add a runsettings file, and add these settings there to the NUnit section. A detailed explanation of the process can be found in [this blog post](https://hermit.no/debugging-the-nunit3testadapter-take-2/)