8
votes

We are currently running an OpenCover session, which is running the nunit3.console.exe.

Our command line is the following:

"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -output:"%CD%\opencover.xml" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"Solution\our-solution-file.sln --config=Debug --result=%CD%\TestResult.xml;format=nunit2"
exit 0

We were expecting this to be slower than our normal unit test due to the instrumentation in between, but not that much.

Without code coverage, the unit tests take something like 1h. And currently, with the code coverage, we already spent 3 days and 23hours, and we think we only executed less 10%.

Those results should be exported to SonarQube after.

Is there something we can do to improve the speed(except upgrading the computer running the test, which will probably be done anyway)?

Like having less detailed results, ... ? We are mostly interested by the code coverage, the duration and other stuff is not very interesting for us. Or even using another tool than OpenCover.

I don't know if this matters, but this line is executed by jenkins.

1
A slowdown of 60x is outright ridiculous. But this SO response suggests it is a property of OpenCover: stackoverflow.com/a/26225013/120163 The remark about using threads and queues is pretty surprising; those are very slow mechanisms to use if they are part of the runtime core of the tool. I'd expect a good test coverage tool to add 15-20% additional overhead to execution. . Semantic Designs (my company's) tools have this property. (See bio).Ira Baxter

1 Answers

2
votes

By trying some things I did notice an huge improvement:

I excluded the tests assemblies of the openCover instrumentation, and now the performances are quite nice:

  • 1h06 only with UnitTests+SonarQube

  • 1h38 with OpenCover+UnitTests+SonarQube

This is quite acceptable for us.

By the way, how I did filter:

"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -filter:"[*]* -[*.Test]*" -output:"%CD%\opencover.xml" -register:user -target:"C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" -targetargs:"Solution\our-solution-file.sln --config=Debug --result=%CD%\TestResult.xml;format=nunit2"
exit 0