NUnit3 doesn't use the .config file when run tests #4223
-
Hello! <TargetFrameworks>net48;net6.0</TargetFrameworks> I run the following in the cake script: var nunit3Settings = new NUnit3Settings
{
NoResults = false,
WorkingDirectory = bin,
Results = new List<NUnit3Result>() {
new NUnit3Result()
{
FileName = $"{output.ToString()}/{outputFileName}",
Transform = "nunit3-junit.xslt",
},
},
};
NUnit3(nunitTestFilesPattern, nunit3Settings); It works very well for the net48. But when run for net6.0 the code inside tests can't read the connection string. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
At a first glance, this does not seem to be an inherent problem with the Cake -> NUnit.Console -> net6.0-Project "pipelene". Are you sure it is not your test that is faulty? Could you share a minimal demo that reproduces your problem? |
Beta Was this translation helpful? Give feedback.
-
@nils-a I have created a small demo https://github.com/alexpantyukhin/TestCake . There is a list of outputs which contains results of tests. The rider works well on it, but when I use the Cake NUnit3 |
Beta Was this translation helpful? Give feedback.
-
Thank you all. I think the issue is clear. It seems the problem is inside the nunit3 console. Another variant is to use DotNetTest as @devlead suggested, |
Beta Was this translation helpful? Give feedback.
Could it be that rider uses .NET SDK dotnet test and not .NET Framework NUnit command line runner?
If so you could try the DotNetTest alias instead.