locked
How to get code coverage for remote testing? RRS feed

  • Question

  • I’m trying to get code coverage working in remote testing scenario, but still no luck. Only data.coverage with empty result so far. My set up is that I have 1 test controller with 40 test agents. I created a remote.testsetting file and enable code coverage. In the “Out” folder of the deployment, instrumented version of dlls are there together with their xxx.instr.pdb files. However in my test agent deployment folder, only dlls are there without instr.pdb. So my guess is that test agent download dll and asks for pdb with exactly the same name. Since dll is instrumented so test agent doesn’t get pdb. Is there any way to set up test agent to download instr.pdb also?

    FYI: I have a schedule task to run a batch file which call MSTest.exe to run test.

    Tuesday, November 6, 2012 11:46 AM

Answers

  • Hi Phaween,

    Sorry for my misunderstanding about this issue.

    In the “Out” folder of the deployment, instrumented version of dlls are there together with their xxx.instr.pdb files. However in my test agent deployment folder, only dlls are there without instr.pdb. So my guess is that test agent download dll and asks for pdb with exactly the same name. Since dll is instrumented so test agent doesn’t get pdb.

    I try to involve someone familiar with this topic to further look at this issue, if possible, you could check your Test Controller, and check whether you could find the information about the xxx.instr.pdb files, we doubt that it is related to the Test controller, you could try to enable the test controller logs to find more information, see “How to enable test controller logs”. Thanks for your understanding.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, November 15, 2012 8:45 AM
    Moderator

All replies

  • Hi Phaween,

    Thank you for posting in the MSDN forum.

    Just to make this issue clearly, which kind of test are you running? Which VS version are you using?

    How did you set your test to get the code coverage remotely? As far as I know, we could only use code coverage when you run an automated test, and only from the computer that is running the test. Remote collection is not supported. For detailed information, see this MSDN document “How to: Configure Code Coverage (Visual Studio 2010) Using Test Settings in Visual Studio”.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, November 7, 2012 7:28 AM
    Moderator
  • Hi,

    I'm trying to run automated UI test win VS2010. Following steps in MSDN document, I can get some business object dll coverage but no UI class coverage yet. So I'm not sure about "Remote collection is not supported". It seems to work partially but not all :). This is what I've done so far

    Added some assembly to get coverage. I added a business object assembly and a UI assembly.

    Added a key file

    After running mstest, I got coverage file from agent in "In" folder. However only business object assembly was covered.

    Thursday, November 8, 2012 5:06 AM
  • Hi Phaween,

    Glad to receive your reply.

    Just to make this issue clearly, do you mean that you want to get the code coverage when you run the test remotely? So it doesn’t mean that you want to collect the code coverage in the remote machine, am I right?

    If so, I misunderstood this issue. As my understanding, we could get the code coverage locally when you run your test remotely. Could you get the code coverage when you run your test locally?

    After running mstest, I got coverage file from agent in "In" folder. However only business object assembly was covered.

    It seems that you run your test in the command line, I suggest you check the Local.testsettings file->Data and Diagnostics->Code Coverage, and open it, make sure that select all artifacts to instrument. When you run your test in the command line, please call the testsettings file here. In addition, if you run your test remotely in VS IDE, could you get the code coverage for it?

    How about using other command line?

    See: http://msdn.microsoft.com/en-us/library/dd299398.aspx

    If still no help, could you share us a sample? We try to run it in our machine.

    Have a nice weekend,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 9, 2012 2:22 AM
    Moderator
  • Hi Phaween,

    Sorry for my misunderstanding about this issue.

    In the “Out” folder of the deployment, instrumented version of dlls are there together with their xxx.instr.pdb files. However in my test agent deployment folder, only dlls are there without instr.pdb. So my guess is that test agent download dll and asks for pdb with exactly the same name. Since dll is instrumented so test agent doesn’t get pdb.

    I try to involve someone familiar with this topic to further look at this issue, if possible, you could check your Test Controller, and check whether you could find the information about the xxx.instr.pdb files, we doubt that it is related to the Test controller, you could try to enable the test controller logs to find more information, see “How to enable test controller logs”. Thanks for your understanding.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, November 15, 2012 8:45 AM
    Moderator