-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add a way to run tests in parallel #80
Comments
Hspec has a Maybe could borrow some design from there? Regarding logs, are you thinking of stuff printed by the code under test, rather than purescript-spec's output? |
yes spec logs just fine if you fork tests, issue is when the code under test is logging stuff |
I like the Tut the issue with logging still is there, I think instead of so you can still log to console but it has test name as prefix, or you just get log when test finishes/fails, instead of output being polluted by random strings from all parallel tests |
When it comes to logging from the code under test, I think it's a slippery slope to provide functionality in purescript-spec, and that we shouldn't implement any special support for it. Rather, we can document |
@felixmulder, any thoughts on logging? |
If ps-spec itself is not providing that then probably Spec should become be something like this:
this way one an use define there own spec:
|
This one's hard because one can redirect stdout/stderr in application code
so taking over them is something that can have adverse effects... Let me
marinate on this
…On Mon, 10 Dec 2018 at 20:04, Irakli Safareli ***@***.***> wrote:
If ps-spec itself is not providing that then probably Spec should become
be something like this:
type TestName = String
type Spec = Spec' Aff
type Spec' m t = State (Array (Group (ReaderT m TestName Unit))) t
this way one an use define there own spec:
type SpecWithCustomLoging = Spec' (ReaderT Aff (String -> Effect Unit))
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABdYwW2wx6zAArc7ugkvSCm14lpT_M6Vks5u3rA7gaJpZM4ZKDKL>
.
|
I think if we add parallel/sequencial we should also provide a way for users to use custom monad then just Aff so it's possible for advanced users to use some custom logging, for example if we add _run
:: forall m
. Config
-> Spec' m Unit
-> (NonEmptyArray Name -> m ~> Aff)
-> Producer Event Aff (Array (Group Result)) This way someone can use if we can provide |
so i have added hoistSpec #82 and par&seq functions (like in hspec) take a look at this example for how it can be used to for logging (nave version vs writer vs reader) and here you can see travis logs https://travis-ci.org/purescript-spec/purescript-spec/builds/466439951#L1285 |
I was thinking on adding
describePar
anddescribeParOnly
. so Description is marked as parallel and during execution in_run
we are run producers in parallel. it would be very useful in case ps-spec is used for running integration tests and some tests don't effect each other.so if you have:
which takes 1500 ms, you can apply this change:
and it will take 500ms.
Main issue would be logging from tests which are executing in parallel, as you would have no way to know from which one a logged message is coming from.
The text was updated successfully, but these errors were encountered: