mercredi 29 août 2018

Test coverage 0% even with tests being executed (Opencover / xUnit)

I am using OpenCover to get the coverage of the tests in my application .Net Core

When I run the OpenCover command, my tests are executed, but no classes are visited. Furthermore, my coverage is always 0.

Total de testes: 2. Aprovados: 2. Com falha: 0. Ignorados: 0.
Execução de Teste Bem-sucedida.
Tempo de execução de teste: 7,6713 Segundos
Committing...
Visited Classes 0 of 18 (0)
Visited Methods 0 of 68 (0)
Visited Points 0 of 133 (0)
Visited Branches 0 of 74 (0)

==== Alternative Results (includes all methods including those without corresponding source) ====
Alternative Visited Classes 0 of 19 (0)
Alternative Visited Methods 0 of 92 (0)

My OpenCover command is this one:

"%LOCALAPPDATA%\Apps\OpenCover\OpenCover.Console.exe" -oldstyle -output:"%CD%\opencover.xml" -register:user -target:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" -targetargs:"InterpretadorFaleConoscoWexTests\bin\Debug\net461\InterpretadorFaleConoscoWexTests.dll"

I already put the tag <DebugType>Full<DebugType> , tried with and without TestAdapterPath and oldStyle and other tags, and no one worked. My coverage is always 0.

Can anyone give me any help?

I´ve seen some people with the same problem. However, there was no answer that solved my problem.

Thank you in advance.

Aucun commentaire:

Enregistrer un commentaire