Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making code coverage optional since it slows things down a lot #138

Closed
rmunn opened this issue Jun 1, 2019 · 0 comments · Fixed by #139
Closed

Consider making code coverage optional since it slows things down a lot #138

rmunn opened this issue Jun 1, 2019 · 0 comments · Fixed by #139

Comments

@rmunn
Copy link
Contributor

rmunn commented Jun 1, 2019

Is your feature request related to a problem? Please describe.
It's very nice having code coverage for my unit tests, but it slows things down enough that I'd like an easy way, maybe a parameter that could be passed to build.fsx, to turn it off. At the moment I'm turning it off and back on by commenting out three lines in the build script, but I'd rather have a command-line parameter.

To give some idea of the slowdown I'm seeing, I have a test suite that took 20.1 seconds to run in .Net Core, and 19.7 seconds in Mono, when I had the code coverage lines commented out. Once I turned code coverage back on, the same test suite on the same computer (a pretty powerful laptop) took 3.33 minutes, which is almost exactly 200 seconds, on both .Net Core and Mono. That's a 10x slowdown. Another test suite had a particularly long-running test that takes about 40 minutes to complete (it creates a huge data structure and runs all kinds of tests on it, and since it's an FsCheck test, about a hundred huge data structures get created). When I ran it with code coverage turned on, it took 2.9 hours, which works out to about a 4.5x slowdown.

Describe the solution you'd like
An "official" way, like a command-line parameter that the build script can parse, to turn code coverage off. It's useful to have it turned on by default when you install a new project, but it's also nice to be able to turn it off while you're running your unit tests over and over chasing down a bug.

Describe alternatives you've considered
Currently I can comment out the three AltCover lines in the DotnetTest target, and that's enough to do what I want. (The GenerateCoverageReport target would fail later on, of course, but while I'm bug hunting I'm just running the DotnetTest target over and over).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant