Closed zubr7 closed 4 years ago
Hi @zubr7 , Thank you for the issue and sorry for the late response. The issue we are having here is that NUnit works a little bit different when running .NET Core tests, see the corresponding issue here: https://github.com/nunit/nunit-console/issues/487
So I had to create a new issue here: https://github.com/GHPReporter/Ghpr.NUnit/issues/57 The idea is that we need a new NuGet package which will be detected automatically by NUnit when running .NET Core tests.
For now, I think it may be possible to use Ghpr.Console package to generate the report from the .xml
file with test results.
Thank you
Hi @zubr7,
Now you should be able to use Ghpr.NUnit
inside your .NET Core test projects.
The solution was to add a new .addins
file which is detected by NUnit3TestAdapter
.
So here is a short instruction on how to quickly set up a .NET Core NUnit
test project with Ghpr.NUnit
(I'm using VS19):
Create a new test project from template:
Install other required NuGet
packages, so the full list will be as follows:
<PackageReference Include="Ghpr.NUnit" Version="0.9.11" />
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Ghpr.Core" Version="0.9.10" />
<PackageReference Include="Ghpr.LocalFileSystem" Version="0.9.10" />
Make sure to include Ghpr.NUnit.Settings.json
and Ghpr.NUnit.addins
files into your project (and mark them with Copy always
attribute). You can find both files in the corresponding NuGet folder of the Ghpr.NUnit
package (starting from v0.9.11):
Run your tests using dotnet test
command:
See the report generated:
Please feel free to reopen this issue or raise a new one in case there is something wrong with how the package works for .NET Core tests.
Thank you.
Describe the bug First of all I'd like to say thank you for your project! Unfortunately, I failed to integrate GHPReporter into my project (.Net Core Nunit test project). I didn't receive a generated file.
To Reproduce Steps to reproduce the behavior:
Expected behavior A HTML report should be generated. I checked the root of C drive, project root folder, 'bin', 'obj' folders.
Screenshots
Versions .Net Core 3.1 GHPReporter 0.9.10, Nunit 3.12.0, Nunit.ColsoleRunner 3.11.1,