-
-
Notifications
You must be signed in to change notification settings - Fork 722
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NUnit3Runner does not work with dot net core 2.1 #3123
Comments
For .NET Core / .NET 5 projects I would recommend using the .NET CLI Test command using the DotNetCoreTest alias. |
My project is dot net core 2.1 |
The .NET Core / 5 SDK exists for You can install SDKs side by side, and they're often installed by the Visual Studio installer, so you've probably already have the SDK with If not you can either install via Visual Studio installer or get.dot.net. |
@devlead I found if I use below command
our test is running, but I have one problem with this, that I cannot specify results path like NUnit3Settings, Did you have any idea to resolve my problem? |
@devlead I cannot use thanks for response |
The VSTest alias VSTestSettings has a Logger property. You could set it to something like |
@devlead Thanks a lot for response, but your solution does not specify result directory as you can see https://docs.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2019
Is there anyway to set ResultDirectory? |
@devlead I use ArgumentCustomization for resolve my problem, But I think this issue is not close, because NUnit3 has Bug for working with dot net core 2.1 I think it is sound good to add ResultDirectory to VSTestSettings thanks a lot for helping me |
@devlead HandleExitCode does not work for VSTest, What did i do can? I set HandleExitCode = _ => true but I got
I found one link maybe can help as you can see in link this tools have settings that name Update: I found my problem, HandleExitCode is correct but my problem is VSTest write standard error when any test failed |
Link to #3127 |
@soroshsabz Could you provide a reproducible example (Visual Studio project + build.cake file) that causes this error? I am not able to repro the error you mention when setting var settings = new VSTestSettings
{
HandleExitCode = _ => true,
};
VSTest(@"C:\augustoproiete\repro-cake-3123\bin\Debug\netcoreapp3.1\UnitTestProject1.dll", settings); using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
throw new InvalidOperationException("boom");
}
}
} Compiling build script...
Resolved tool to path C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/vstest.console.exe
Executing: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/vstest.console.exe" "C:/augustoproiete/repro-cake-3123/bin/Debug/netcoreapp3.1/UnitTestProject1.dll"
Microsoft (R) Test Execution Command Line Tool Version 16.8.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Failed TestMethod1 [17 ms]
Error Message:
Test method UnitTestProject1.UnitTest1.TestMethod1 threw exception:
System.InvalidOperationException: boom
Stack Trace:
at UnitTestProject1.UnitTest1.TestMethod1() in C:\augustoproiete\repro-cake-3123\UnitTestProject1\UnitTest1.cs:line 12
Test Run Failed.
Total tests: 1
Failed: 1
Total time: 0.7013 Seconds
C:\augustoproiete\repro-cake-3123>echo %ERRORLEVEL%
0 |
@augustoproiete As I update my comment, I found my problem, and HandleExitCode is correct sorry for that :( |
@soroshsabz No worries. Moving this one to the GitHub Discussions area then. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
ITNOA
What You Are Seeing?
When I was use
NUnit3(testProject.DllFilePath, settings)
with dot net core 2.1 project I got many exception.What is Expected?
NUnit3 work properly with any type of NUnit test project
What version of Cake are you using?
1.0.0
Are you running on a 32 or 64 bit system?
64 bit system
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
Create dot net core 2.1 project with NUnit3 template from visual studio 2019 and then try run cake file with below command
NUnit3(testProject.DllFilePath, settings)
Output Log
The text was updated successfully, but these errors were encountered: