tasty
tasty copied to clipboard
It would be nice to be able to limit the number of jobs used by `TestTree`s
From looking at the code and experimentation, I believe that the NumThreads
option only takes effect at the top-level. So you can't, for example, limit a particular test tree to be run with only one job (in case the tests interfere with each other).
I think sequentialTestGroup
can be used for enforcing sequential execution on more granular level. Haven't tested how it behaves if you mix it with testGroup
.
And that led me to ExecutionMode
, which seems like it's exactly what I want but sadly isn't exported. Maybe there's a reason why it's only available through sequentialTestGroup
, but I'm not sure :thinking:
Indeed, sequentialTestGroup
does not do what I want, since it only makes the tests directly in the group run sequentially, whereas tests in nested groups continue to execute in parallel. I really do just want to set the execution mode to sequential for a whole test tree!
@michaelpj it is admittedly awkward, but you can pattern-match on
PlusTestOptions mkSequential = sequentialTestGroup "foo" AllFinish []
and then
defaultMain $ PlusTestOptions mkSequential testTree
I'm curious if it works, please tell if you give it a try.
contructors of TestTree aren't exported, so PlusTestOptions is not visible :/
@dyniec constructors of TestTree
are exported from https://hackage.haskell.org/package/tasty-1.5/docs/Test-Tasty-Runners.html#t:TestTree