Questions tagged [dotnet-test]

36 questions
15
votes
2 answers

dotnet test not creating test results folder

As part of our ASP.NET Core 2.0 build process I have added a dotnet test command which I have added as a Windows batch file. Here is my command. dotnet test "MyProject.csproj" --no-restore --results-directory "MyProject\TestResults" --verbosity…
DomBurf
  • 2,232
  • 3
  • 27
  • 55
10
votes
2 answers

How to debug dotnet test in VS Code?

This article describes setting the VS Code settings to point the debugging target at the build output of the unit test project. I have therefore set mine like this: { "explorer.confirmDragAndDrop": false, "git.allowForcePush": true, …
Matt W
  • 9,407
  • 17
  • 83
  • 146
7
votes
0 answers

How to merge two or more dotnet test code coverage files

I have a .Net solution with two dotnet core class libraries and its associated unit test projects in it. When I run dotnet test **\*.Tests.csproj --collect "Code Coverage" command then it generates separate .coveragexml files for each unit test…
Prado
  • 914
  • 10
  • 21
6
votes
2 answers

Test multiple projects with dotnet test using pattern

I am writing a script to build and test projects in a repository. For now I'm using the PowerShell command Get-ChildItem -Path test -Filter *.csproj -Recurse | ForEach-Object { dotnet test $_.FullName -c $Configuration } to get all .csproj files in…
Valuator
  • 2,285
  • 17
  • 40
6
votes
3 answers

How can I debug my tests .Net Core 2.0 in VSCode

I'm searching a way to debug my tests (mstest) .Net Core 2.0 in VSCode? I didn't find nothing. Thanks!
4
votes
1 answer

Github Actions: Report dotnet test result as annotations

If you run tests using Azure Pipelines you would get some cool results on the checks tabs. Is there any way to do the same from Github Actions so we don't have to go through the console output?
hardkoded
  • 13,167
  • 3
  • 34
  • 48
4
votes
3 answers

How to run dotnet test on VSTS with custom NuGet feed?

We have a project with a dependency on a custom NuGet feed (also hosted in VSTS). I'm trying to put together a new phase to generate code coverage reports, as in this blog post. My new phase looks like this: And is made up of the following…
3
votes
0 answers

Azure Pipelines and Xunit Together

I am trying to track down a bug in my Xunit acceptance tests on Azure Pipelines and want to enable stoponfail to make the problem easier to track down. It's an intermittent timing thing, so hard to reproduce running tests locally. I have the…
Jeff
  • 32,948
  • 13
  • 96
  • 198
3
votes
0 answers

Run dotnet test without full SDK installed

I would like to run some nUnit tests on a build server, without having to install the .NET Core SDK there. The tests target netcoreapp3.1. For .NET Framework it was possible to run them using the nunit-console-runner, but it doesn't seem to be…
Grzegorz Smulko
  • 1,740
  • 15
  • 33
2
votes
1 answer

Passing an extremely long filter to dotnet test?

I am trying to pass an extremely long filter to dotnet test --filter. However, it is so long, that I get a "path too long" error. Is there any other way to specify a filter? Or alternatively somehow "pipe" a filter from a file into the --filter…
Mathias Lykkegaard Lorenzen
  • 13,158
  • 19
  • 85
  • 163
2
votes
0 answers

How to add [ExcludeFromCodeCoverage] attribute at an assembly-level in a .Net Standard 2.1 project

I have a .Net Core application which has got one .Net Standard 2.1 project in it. I am using Coverlet to get the code coverage in Cobertura format. I am using "coverlet.msbuild" nuget package in all my Test projects. I want to add…
Prado
  • 914
  • 10
  • 21
2
votes
1 answer

'dotnet test' is not finding nunit tests in gitlab-runner pipeline

I have a solution with a NUnit testproject (Foo.Test). +-- src | +-- Foo.Gui | +-- Foo.Test netcoreapp3.0 false
Dominic Jonas
  • 3,671
  • 1
  • 25
  • 55
2
votes
1 answer

Why dotnet test tool is not creating code coverage report?

My project structure is the following: . ├── Application ├── Application.Core ├── Application.Domain ├── Application.Tests ├── Application.IntegrationTests └── README.md And the command to run my test I use the following input: dotnet test…
ajr
  • 522
  • 1
  • 6
  • 24
2
votes
1 answer

`dotnet test` capturing garbage characters which mess up the output - need to remove

I am similar issue to expect script capturing garbage characters - need to remove. Logs and console output contain these ANSI escape sequences and messing up with the resulting output. It became difficult to understand what is going on in actual…
pmunshi
  • 21
  • 4
2
votes
1 answer

Dotnet test ignoring filter when on Linux

I'm using xunit, with trait attributes set on some of my tests. When running dotnet test I'm trying to filter by these traits. I have it working fine locally on my Windows machine but when I run the same command on my CI container then it doesn't…
Matt Keen
  • 109
  • 1
  • 7
1
2 3