I'm using ghcid to run an hspec testsuite. hspec allows to parallelize the test execution. However, by default, the testsuites only use one capability (as witnessed by getNumCapabilities). Which means, that the tests will only be executed in pseudo-parallel. I can change the behavior by calling e.g. getNumProcessors >>= setNumCapabilities before the tests. And with that I can observe a speed-up in test execution in an example testsuite. But that's a bit sad, for two reasons:
- It means that
+RTS -N$some_number options passed into the testsuite when compiled (i.e. not running through ghcid) will be ignored.
- I have to remember to do this, whenever I want truly parallel test execution with
ghcid.
Can I somehow pass in -N as an RTS option to ... well, I don't even know. ghci? Or --test ':main +RTS ...'? (The latter doesn't work.)
Also, should using more capabilities be the default?
My full ghcid invocation looks like this, if that matters:
ghcid --command "cabal repl test:spec" --test ':main' --warnings
See also: https://hspec.github.io/parallel-spec-execution.html
Thanks!
I'm using
ghcidto run anhspectestsuite.hspecallows to parallelize the test execution. However, by default, the testsuites only use one capability (as witnessed bygetNumCapabilities). Which means, that the tests will only be executed in pseudo-parallel. I can change the behavior by calling e.g.getNumProcessors >>= setNumCapabilitiesbefore the tests. And with that I can observe a speed-up in test execution in an example testsuite. But that's a bit sad, for two reasons:+RTS -N$some_numberoptions passed into the testsuite when compiled (i.e. not running throughghcid) will be ignored.ghcid.Can I somehow pass in
-Nas anRTSoption to ... well, I don't even know.ghci? Or--test ':main +RTS ...'? (The latter doesn't work.)Also, should using more capabilities be the default?
My full
ghcidinvocation looks like this, if that matters:ghcid --command "cabal repl test:spec" --test ':main' --warningsSee also: https://hspec.github.io/parallel-spec-execution.html
Thanks!