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

Allow using more capabilities #391

Open
soenkehahn opened this issue Dec 13, 2024 · 0 comments
Open

Allow using more capabilities #391

soenkehahn opened this issue Dec 13, 2024 · 0 comments

Comments

@soenkehahn
Copy link

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:

  1. It means that +RTS -N$some_number options passed into the testsuite when compiled (i.e. not running through ghcid) will be ignored.
  2. 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!

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

No branches or pull requests

1 participant