Configuring dotCover with MSTest

Greetings,

I've been searching the NET and apparently no situation seems to apply to my current scenario.

I've setted the MSTest with a vsmdi test list file, configuring the tests to be ran from a set of test list. This is done because some of my tests require to be ran in an specified order, and so far this part is working as advertized.

However, now, I want to add a code coverage alongside with my tests because I fear that my tests don't cover much of my codebase.

Following the instructions we found on the net, I setted up the dotCover to run alongside MSTest.

And got the following log message:

No executable code was detected. Please check: - Include / exclude patterns are correct - Assemblies were compiled with debugging information - .pdf files are available



Does anyone have any pointers on what to do?

This is my configuration :

Step 3                            : MSTest (Microsoft MSTest test runner) MSTest                            : enabled Path to MSTest.exe                : %system.MSTest.9.0% MSTest assemblies                 : %system.teamcity.build.workingDir%\TeamCity.testrunconfig MSTest run configuration file     : <empty> MSTest metadata                   : %system.teamcity.build.workingDir%\MyTestListSpec.vsmdi Testlist from metadata to run     : MyTestList Test                              : <empty> Unique                            : OFF Results file                      : none specified Additional commandline parameters : none specified .NET Code Coverage                : JetBrains dotCover .NET Runtime                      : .NET Framework 2.0 x86 Path to dotCover home             : use bundled Filters                           : +:*
                                    -:*Tests

9 comments
Comment actions Permalink

Hi Paulo,

The log message should really say ".pdb files are available". You need to make sure that your projects are built with debug info to generate pdb files for the test assemblies. You have to turn on debug info in project properties in VS and set it to either "pdb-only" or "full". This has to be done for the configuration/platform combo that you are compiling in TeamCity (Release/Debug, AnyCPU/x86/x64). Please verify that the directory where the tested assemblies are located on the build agent indeed have pdb files after compilation and before tests are executed.

Best regards,

Oleg.

0
Comment actions Permalink

Hello, Oleg.

Yes, everything is as it should be.

The PDB files are there and the project is compiled for debug, as I'm setting this for the development server.

0
Comment actions Permalink

Paulo,

Does you .testrunconfig file have CodeCoverage section with enabled="true"? VS built-in coverage has to be disabled for dotCover.

0
Comment actions Permalink

Yes, I know that... So, no code coverage setted with TeamCity configuration.

0
Comment actions Permalink

OK, I have a build config setup for MSTest 10.0, which is similar to yours except that I use native platform and version for .NET Runtime option of dotCover and the filters are blank. I get coverage info without a problem. Are you getting coverage info when you run dotCover in Visual Studio? Which version of TeamCity are you on?

0
Comment actions Permalink

I'm using 6.0... but I'm not sure if it's 6.0.0 or 6.0.1.

Right now I'm at home, it's kinda of a holiday here, and I can't check it.

However, I'm running MSTest.9.0 using MSBuild, an no code coverage whatsoever.

I tried no filter oprions too, and the message is the same. :-\

0
Comment actions Permalink

Oleg, thank you for a suggestion. I think it should be implemented as a feature in TeamCity.
Please vote for it at http://youtrack.jetbrains.net/issue/TW-15776

0
Comment actions Permalink

Please attach build log and build configuration screenshot with all fields expanded.

0
Comment actions Permalink

Just an update... I was using the 6.0.0 version, after upgrading to 6.0.2 the code coverage ran without incident.

So I guess the 6.0.0, although advertize as such doesn't quite run the code coverage well.

0

Please sign in to leave a comment.