-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Reuse coverage data from test run (Second try) #214
Comments
Sorry I just realized that I probably should have put this into the discussion area instead of into issue. Feel free to close it and move it if you prefer. |
Like this ? A solution with 2 test projects that have run settings files with the appropriate Data Collector and path. CoberturaTest.-.Microsoft.Visual.Studio.-.Experimental.Instance.2022-02-13.18-23-51.mp4New code. If there are run settings for the projects with tests being run then we skip normal FCC execution and collect the test result directories. When the tests have finished the cobertura files are found and the FCCEngine does report generation and coverage lines as per usual. Unfortunately the recording cannot show the report appearing in the Fine Code Coverage tool window. FineCodeCoverage.Running.-.Microsoft.Visual.Studio.2022-02-13.18-28-11.1.1.mp4@FortuneN Benefits If you are still looking at doing your own instrumentation then you might want to download the nuget and look inside ! ( OpenCover is now in archive mode ) |
Glad to see that you want to pick this up! :-) I have already implemented this in my own branch and am using it actively. I wanted to wait for feedback from you guys first before acting on pushing anything to the repo. On top of what you already wrote, I have implemented automatic adding of runsettings with the appropriate test adapter, in case no runsettings are present so that the user does not need to worry about that but still gets the better performance. Much more user friendly this way if you ask me. This behaviour can be enabled via a FineCodeCoverage option. Regarding .net core only: I was able to make it work with .net framework projects as well by copying some needed dlls to the output directory. This is done automatically on project build as well by the code in my branch. In fact I eat my own dogfood (well your dogfood to be more precise ;-) ) and tested it with FineCodeCoverage's own unit tests and it worked fine apart from the issue with the reportGenerator. I could push my changes to a branch if you grant me contributor rights, so that you could have a look/pick up the changes if you want. I am pretty sure it would need to be polished as I did some quick coding just to get it running. There used to be one minor issue in the report generator that I reported to Daniel when using the Microsoft collector. |
I was unaware of the new dotnet functionality. Similar to what I had suggested in #57 but more relevant now I think. I think it is essential but Fortune decides ultimately.
Interested in that. This is done at test time rather than a vs command ?
Interesting. Where did you find information on this solution ? On vstest repo ? How does it work ?
That's up to @FortuneN . You could email me your fork ?
We are currently fixed with version 4.7.1. Have you changed any of the report generation code ? |
Is there a runsettings setter that can be accessed with reflection that is respected after the TestContainerDiscoverer has finished ? Just notice that there is some information in reflection that can save a bit of processing in the code that I wrote this afternoon. |
Build step ? |
I assume you are including the nuget as a zipped tool ? Are you excluding the test adapter as I found that there were results for NUnit3.TestAdapter ? https://docs.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022 |
Tony, all the questions are more or less answered once you have a glance at the code. I have not pushed my code yet to a fork on github. This issue was in hibernation for month - so I think we can wait a bit more until we hear back from Fortune. |
I'm happy to accept more contributors.
|
Ok cool so we will add the new functionality.
I would like to determine all the outstanding tasks before opening up to more contributors - no offence @mschnelte . Once I have done that, it might be in a month or so, then accept additional ideas and contributor/s.
@mschnelte I will not be creating any more pull requests of my own until we have added this functionality. So please create a pull request or if the two repos have diverged too much then just send me your code. |
Had to resolve issues. I have one more to do this afternoon. |
I just created a fork. |
Hi everyone,
I would like to revisit the idea already pitched in #57
Using coverlet in the runsettings did not work for me because the Known Issues hit me.
However the "native" code coverage from microsoft is making some good progress. They have just a few days ago released a new preview that outputs Cobertura files directly
For me taking the coverage output from the test run instead of re-running the whole test project again would be a huge improvement. We have some integration tests in our projects and it takes quite a while for them to finish. In its current state FCC is not really usable. Taking the coverage results from the runsettings ResultsDirectory would mean that:
Can you maybe comment why you have abandoned the proposed idea in #57?
I have some modified version of FCC that takes the coverage result from the last test run and it works pretty fine and enables me to use it even with slow running tests.
Here is the runsettings I am using: (i have downloaded the preview package into c:\temp\ms.codecoverage)
The text was updated successfully, but these errors were encountered: