locked
Seeing same file listed twice in code coverage results RRS feed

  • Question

  • When I do a code coverage run using my unit tests, I see the same file MyApp.exe with a out of range time stamp.  Expanding that exe shows the code for each one 

    For example - code coverage results show:

    MyApp.exe (8/2/2094 5:28:29 PM)

    MyApp.exe (8/1/2074 5:03:05 PM)

    In one case Program has 59 covered and 148 not covered.

    In the other MyApp.exe it has 0 covered.  Clicking on the actual program() in either one brings me to the same code file.  I don't know why they are listed twice and I don't know what the real code coverage result is. I would think a merge of the two is what I would want to do.

    Why would it list it twice?

    Thursday, January 31, 2019 12:11 AM

All replies

  • Hi friend,

    Sorry for that I haven’t reproduce this issue at my side. Do you use VS IDE or MTM or TFS to run the unit test. Cause the format of “MyApp.exe(…)” you mentioned above seems not to be the display type in VS IDE like below:


    So could you please share more info here. If you use VS IDE or MTM and encounter such issue , I need to know what kind of project you use, and it would be better if you can share a screenshot about the code coverage results.

    And if you use TFS or VSTS, I’m afraid that you need to open a new thread in StackOverFlow or Developer Community with TFS or VSTS tag cause it’s more related to TFS and VSTS.

    Thank you for your understanding. We are looking forward to your reply.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, January 31, 2019 10:17 AM
  • It is VS 2017.  I have seen it when I run code coverage in VS or when I run it from command line (vstest.console.exe %testdir%\AmbrosiaTest.dll /EnableCodeCoverage /Settings:%testdir%\CodeCoverage.runsettings /logger:trx)

    Here is an example of our Ambrosia code coverage. Notice Ambrosia.exe is listed twice.  Job.exe and Server.exe are listed twice as those are separate apps of the same name.

    Thursday, January 31, 2019 4:44 PM
  • One other thing … my test (AmbrosiaTest) launches all of these as separate exe processes so maybe that has something to do with it.

    If you really want to dig in, you can get the code from open source GitHub: https://github.com/Microsoft/AMBROSIA

    Thursday, January 31, 2019 4:46 PM
  • Hi friend,

    Sorry for the delay to reply to you. I do want to reproduce the issue so i spending time reading the code.But this workload is quite large and i can't make sure the cause of it for now. 

    But I find something strange about it:

    1.As i find the bat file(launchUnitTest.bat) is to run the specified tests. (If i misunderstand anything,please correct me). And in which way we use the bat file, I haven't find any code to run the bat file. Does this means this issue have nothing to do with bat file.

    2.As i know, in Unit Test, we always use code coverage analysis to analyze assembly, I'm not sure if the issue is related to the separate exe processed you use. So if we only analyze the assemblies, what's the result?

    3. I've made some tests to reproduce the issue. And after I merge the results i have screenshot below:

     This looks similar to your issue.And the difference is yours are exe and these are assemblies. So please make sure the .coverage file we opened is a original one. Since if the .coverage file we opened comes from a file which merge two results, the format is normal.

    Thanks for your understanding. Look forward to your reply.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 5, 2019 8:42 AM
  • To answer your questions:

    1) I run the LaunchTests.bat from an admin cmd prompt in the bin dir of AmbrosiaTest (making sure AmbrosiaTest bin has all the files from the zip file in the release folder of GitHub site)

    2) I have not ran all tests from VS Test Explorer using code coverage analysis. For some reason, I don't have the success passing due to overhead of VS (that is why I just run from cmd prompt)

    One side note … I had to modify the Ambrosia project a bit to NOT use AmbrosiaLibCS nuget package. I wanted to get code coverage on that file as well.  

    Later on this week, I will try code coverage from VS Test Explorer and see how it goes.

    Thanks

    Darren

    Tuesday, February 5, 2019 6:35 PM
  • Hi Darren,

    Thanks for your feedback.

    Any update you can share here.

    We look forward to your reply.

    Best Regards

    Lance 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 6, 2019 6:36 AM