FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
526 stars 40 forks source link

Request: Run on demand #400

Closed mdima closed 6 months ago

mdima commented 7 months ago

Hello, I just discovered this extension and I really love it. Just: I would like to run the Coverage Test only when I decide to run a global test, not when I run a single Unit Test.

Is there any way to run it "on demand"? I did not find anything in the documentation...

Thanks, Michele

tonyhallett commented 7 months ago

I assume you do not like it when running a single test will run all tests. By setting the option RunMsCodeCoverage to true only what you select in test explorer gets tested and receives coverage.

mdima commented 7 months ago

I assume you do not like it when running a single test will run all tests. By setting the option RunMsCodeCoverage to true only what you select in test explorer gets tested and receives coverage.

Hello, thank you for your answer. Well... this option makes the things easier, but still I get marked as "not tested" all the rest of the code that is not involved in the test I just run.

Probably a simple button "calculate coverage" to click on demand would be easy to manage. I mean, this utility is super-useful, just produce a lot of elaboration (and results) during the normal developing.

Thanks, Michele

tonyhallett commented 7 months ago

Probably a simple button "calculate coverage" to click on demand would be easy to manage.

No. Coverage works by reacting to the test explorer.

As it stands disabling clears all coverage too so that is not an option either.

Afraid you will have to wait until this feature ( actual specific desired behaviour not provided in either issue ) is implemented. https://github.com/FortuneN/FineCodeCoverage/issues/325 https://github.com/FortuneN/FineCodeCoverage/issues/316

If you could explain in either of those issue how you expect FCC to behave given the information available which is solely the cobertura file before and after then that would be great.

tonyhallett commented 7 months ago

If you could explain in either of those issue how you expect FCC to behave given the information available which is solely the cobertura file before and after then that would be great.

and the code files in the project.

mdima commented 6 months ago

Hello, yes, I think this issue is related to the #316 issue. I am trying FCC in a quite big project where we have more than 270 tests, and running them takes about 10 minutes (there are call to some external APIs that have a request quota). So what I see is that I run the tests, after that FCC starts to process all the tests again (instead of using the previous run as source for its data), and that doubles the time we have to wait. Also, another way could be running directly FCC...

Anyway, if you don't have VS Enterprise this is a very useful tool...

Thanks, Michele

tonyhallett commented 6 months ago

So what I see is that I run the tests, after that FCC starts to process all the tests again (instead of using the previous run as source for its data), and that doubles the time we have to wait

I believe that you are saying that FCC runs all the tests again. This does not occur if you set the RunMsCodeCoverage to Yes.

mdima commented 6 months ago

Yes, you are right. I tried RunMsCodeCoverage to Yes, but with this setting the only analysis I receive is on the TestMethod I run, nothing else. The method I test during the unit test are not analized (no entry in the FCC window and no line coverage in the tested method).

Another thing which is not easy to understand is when the extension is running some test or not. Maybe a kind of "semaphore" in the FCC window would be useful.

Thanks, Michele

tonyhallett commented 6 months ago

I tried RunMsCodeCoverage to Yes, but with this setting the only analysis I receive is on the TestMethod I run, nothing else. The method I test during the unit test are not analized (no entry in the FCC window and no line coverage in the tested method).

The method you test does get analysed.

Another thing which is not easy to understand is when the extension is running some test or not.

image

There is an asterisk semaphore.