Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Improve speed openCover

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.

like image 858
J4N Avatar asked Jan 31 '17 08:01

J4N


1 Answers

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
like image 141
J4N Avatar answered Sep 18 '22 17:09

J4N