.NET Core Test Explorer
- Test Explorer for .NET Core
- .NET Core is installed
- NUnit and MsTest requires a dotnet sdk version of >= 2.1.2 and running dotnet tooling in english (see #77 for details).
New in 0.6.6
- We had some problems with displaying test fails as Problems. Those problems are hopefully gone now.
- Added a setting to discover/build and run your tests in parallel if you have multiple test projects. This might use a bit of cpu.
Open a .NET Core test project, or set
dotnet-test-explorer.testProjectPath to the folder path of .NET Core test project. Then, you will see all the tests in Test Explorer.
By utilizing auto watch (see settings) test can be run upon changing in files.
Configuring multiple test projects
Setting dotnet-test-explorer.testProjectPath accepts a glob pattern that should point to your test directories. You can also point to files and it will figure out the corresponding path.
Given the folder structure
the glob pattern "+(testProjectOne|testProjectTwo)" or "**/*Tests.csproj" should add both of the test projects.
Due to some performance concerns discovery and test running over multiple directories are run one at a time in a synchronous fashion. When running specific tests (eg, not running all tests) the extension should be smart enought to figure out which test directory should be run and only run tests for that directory.
Stopping the current test runner(s)
Press the stop button in the top menu. After killing the processe(s) it will perform a new test discovery.
Text from the dotnet test output as well as debug info is written to the Output/Test explorer terminal window. To view the log you can access it simply by clicking the view log icon.
Run all tests, default Alt+R Alt+A
Rerun last command, default Alt+R Alt+R
Run test(s) in context, default Alt+R Alt+C
dotnet-test-explorer.testProjectPath: Glob pattern that points to path of .NET Core test project(s). (Default is "")
dotnet-test-explorer.useTreeView: If false, will list all tests as the full namespace. When set to true a tree will be created based on the namespaces of the tests. (Default is true)
dotnet-test-explorer.showCodeLens: Determines whether to show the CodeLens test status or not. (Default is true)
dotnet-test-explorer.codeLensFailed: The text to display in the code lens when a test has failed. (Default is "")
dotnet-test-explorer.codeLensPassed: The text to display in the code lens when a test has passed. (Default is "")
dotnet-test-explorer.codeLensSkipped: The text to display in the code lens when a test has been skipped. (Default is "")
dotnet-test-explorer.pathForResultFile: The path to (temporarily) store test result files in. (Default is os temp dir)
dotnet-test-explorer.autoExpandTree: If true, the tree will be in an expanded state by default. (Default is false)
dotnet-test-explorer.addProblems: If true, failed tests will add to problems view. (Default is true)
dotnet-test-explorer.autoWatch: If true, starts dotnet watch test after test discovery is completed. (Default is false)
dotnet-test-explorer.testArguments: Additional arguments that are added to the dotnet test command
dotnet-test-explorer.leftClickAction: What happens when a test in the list is left clicked. (Default is gotoTest)
dotnet-test-explorer.runInParallel: If true, will discover/build and run test in parallel if you have multiple test projects (Default is false)
Go to test does not work with multiple workspaces
This is because of limitations in the omnisharp extensions. We can only navigate to symbols which are in the currently selected workspace.
Test result is not shown in codelens / tree
Try and change the setting dotnet-test-explorer.pathForResultFile to point to a folder you have access right too. Code lense functionality also requires the C# extension)
No tree view or color coded explorer for nunit / mstest
This requieres you to run dotnet sdk version 2.1.2 or higher and running dotnet tooling in english (see #77 for details).
DisplayName attribute not working for xunit
Project discovery with UNC Paths doesn't work
AutoWatch does not work with multiple projects
The watcher is only setup to watch the first directory it finds.
By default, anonymous telemetry data collection is turned on to understand user behavior to improve this extension. To disable it, update the settings.json as below:
See Change Log here
If you find any bug or have any suggestion/feature request, please submit the issues to the GitHub Repo.
Thanks to all the contributors!
Special thanks to Stefan Forsberg (@stefanforsberg) for maintaining the project and implementing so many cool features! Also thanks to Janaka Abeywardhana (@janaka) for maintaining the project!