Skip to content

Allow using more capabilities #391

@soenkehahn

Description

@soenkehahn

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions