AxoCover icon indicating copy to clipboard operation
AxoCover copied to clipboard

.Net Core is not supported (yet)

Open cseymr opened this issue 7 years ago • 21 comments

Sorry, this isn't quite the right place to ask this, but it might turn out to be a documentation issue, so... :-)

I'm missing a really obvious step. Axocover is saying 'Hmm.. AxoCover found no unit tests...' in the Tests panel, but I do have some in the Solution - as per screenshot. Using Xunit, if that makes any odds.

image

cseymr avatar Apr 05 '17 10:04 cseymr

Current release version only supports MSTest, Latest prerelease version supports XUnit. Go to https://github.com/axodox/AxoTools/releases and check latest xNUnitSupport build.

axodox avatar Apr 05 '17 19:04 axodox

Thanks, Péter. The latest version recognises the tests and can run them; but 'Cover' gets stuck on 'Initializing test runner...' Let me know what information I can send you if you need it.

cseymr avatar Apr 06 '17 05:04 cseymr

I used version VS2017Support-1.1.57, however no Xunit tests are found.

Note that I'm using a netcoreapp1.1 for the tests.

For my project see https://github.com/StefH/System.Linq.Dynamic.Core

StefH avatar Apr 09 '17 07:04 StefH

.Net core is not yet supported. It will come depending on how much free time I have, which is not much as of now.

axodox avatar Apr 09 '17 20:04 axodox

@craigseymour I have made some significant changes which addressed issues resulting in same behavior as you described. Can you try latest xNUnitSupport release? Maybe it helps you too...

axodox avatar Apr 15 '17 22:04 axodox

Using xNUnitSupport-1.1.68 in VS2017 no tests are found for this project: https://github.com/aspnet/Microsoft.Data.Sqlite which uses xunit tests.

AlexanderTaeschner avatar Apr 20 '17 12:04 AlexanderTaeschner

Json style projects and .Net core is not supported yet, it is planned after next major update.

axodox avatar Apr 20 '17 17:04 axodox

Currently OpenCover only support full pdbs - https://github.com/OpenCover/opencover/issues/601 We do have wip that supports portable and we are looking at supporting embedded PDBs (once we have the latter working then we will look to make a new release)

sawilde avatar Apr 20 '17 21:04 sawilde

Great, by that time I should also have the xUnit, NUnit, MSTestV2 changes finished and released, so I can work on the .Net Core support. This will also require changes in AxoCover since the VS API to query these projects is different and I also need to make my test host .Net Core capable.

axodox avatar Apr 21 '17 05:04 axodox

xUnit stuff is now working great for us (bar some non-fatal errors about not being able to find runner.json files that we're not using). Thanks, Péter.

cseymr avatar May 18 '17 12:05 cseymr

I will comment that if it would be interesting. I had problems with an assembly that is .net standard, because it wasn't covered by the tests. This is because in the properties of the project, in build options, in the button of advanced options, the PDBs was set as portable. When I changed that to full, then the assembly was added to the results of the tests.

Perhaps with .net Core it happens the same, that you have to change the PDBs to full.

ComptonAlvaro avatar Jun 01 '17 07:06 ComptonAlvaro

Ms just released netstandard/core 2 which is much more complete and stable, so hopefully we'll see Core support soon... ☺️

grokky1 avatar Aug 17 '17 04:08 grokky1

I found the same problem because I am using the netcore2.0. Hope for this festure.

watsonsong avatar Sep 26 '17 09:09 watsonsong

xUnit stuff is now working great for us (bar some non-fatal errors about not being able to find runner.json files that we're not using). Thanks, Péter.

Is that also working for .NET Standard 2 for you? I got this (not sure if that's the expected result for now):

image

304NotModified avatar Oct 09 '17 15:10 304NotModified

Hi, I am sorry to say it, but I decided to hold off the .Net Core work for now.

Unfortunately I really don't have the free time required to support so many test frameworks and platforms by myself while they keep changing (along with Visual Studio updates). So I will stick with supporting what I actually need at work and some of the things people ask which still fit in the timeframe I am willing to put into it.

If you have more time than me, I am willing to give help to support .Net Core in AxoCover. So please tell and I will brief you on what has to be done.

There is a chance I will work with .Net Core next year, if that happens I will likely bring support for it at that time (might be half to one year from now).

axodox avatar Oct 15 '17 15:10 axodox

This is a duplicate of #9. Would recommended to close one of the issues.

304NotModified avatar Nov 17 '17 18:11 304NotModified

Hi @axodox. In reference to your comment, can you describe the detail and scope of the work that needs to be done in order to fully support .NET Core 2.x based on .NET Standard 2.0? If it's inconvenient to do so here, please send to me at dexter[dot]valkyrie[at]outlook.com.

Thanks!

skynode avatar Feb 27 '18 01:02 skynode

Hi @skynode. I made a list for you below:

  1. I suggest to try OpenCover support for .Net Core out first without AxoCover, a post here provides a starting point: https://github.com/OpenCover/opencover/issues/756, note this will require changing some build settings of the target project unlike for the full framework. This should be done with latest published non-beta OpenCover.
  2. Then we need to solve how to integrate .Net Core with AxoCover. AxoCover uses its own runner, which in turn use forked versions of the VS runners for MSTest, xUnit and NUnit (these are to support some features, such as the hierarchic display of tests). Now, I would suggest to forget about the forks, and instead research the main problem, and I will do the integration in a weekend or two. My main problem is that the current runner is for the full framework, and I have found loading .Net Core dll-s into it problematic, esepcially the dependencies. Therefore we have some options: -- We port AxoCover runner to .Net Standard. This could work, will need some P/Invoke for some native code. Then we could run it with the dotnet tool and should be able to load dependencies. The dependency loading must be dynamic though. -- We use dotnet test, and offer a separate test runner, this will then need custom collectors to supply test output data, and the forked adapters need to be created for some features to work (or solve those features differently, I need to check into this). -- We use the vstest from now on, and get rid of forks etc.

Yes, as you see, best would be to refactor the code first (not that it is ugly, but it has some solutions currently which I want to replace, as they are hard to maintain - also I have more experience with these test frameworks now), to make the integration simpler. For now I suggest you to try the first step: get it working with OpenCover directly. And find out what needs to be done there. If and when that is OK, I will do some refactoring and then we can select a solution, be it vstest, dotnet test, or a ported AxoCover.Runner. Then we can split up the work and do it.

axodox avatar Mar 01 '18 07:03 axodox

@axodox will this https://github.com/tonerdo/coverlet/ be helpful? Problem with OpenCover is it does not use portable pdb.

neurospeech avatar Mar 23 '18 05:03 neurospeech

Is anyone actively working on this? I don't know how much time I could dedicate to adding Core support, but I'm willing to make a start, if no one else has

IFYates avatar Aug 29 '18 12:08 IFYates

Seems like it's not coming 😔

IanIsFluent avatar Feb 16 '19 08:02 IanIsFluent