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

better support for SimpleCov #35

Open
konk303 opened this issue Mar 30, 2016 · 2 comments
Open

better support for SimpleCov #35

konk303 opened this issue Mar 30, 2016 · 2 comments

Comments

@konk303
Copy link

konk303 commented Mar 30, 2016

I'm using SimpleCov and had some time making it work with test-queue.

SimpleCov does support merging results of multiple tests (processes or threads or another test frameworks).

how it work is

  1. Keep different name on each processes (in SimpleCov.command_name)
  2. Each processes records it's result to a json file on exit, with it's stored name as key
    (SimpleCov.result does recording and return merged result)
  3. Then at the end (or could be at each end), call Simple.cov.result.format! to
    create merged result in html (or in other format)

It relies heavily on Kernel.at_exit, which will be invoked on Kerenl.exit but not on Kernel.exit!.
(how they do it)

The problem is test-queue is killing master with exit!, thus at_exit is not executed at the very end.
Currently I'm using hacky way of killing master by kill inside TestQueue::Runner#summarize,
just before TestQueue::Runner#summarize kill! it.
(An example of my configuration)

If master process exits with exit, it is so much easier to play nicely with simplecov.

While killing forked processes by kill! is a safe idea, killing master with kill! is not really necessary IMHO.

@ryanong
Copy link

ryanong commented Jun 15, 2016

the way I have fixed this was in the def cleanup_worker run SimpleCov.at_exit.call

@aroben
Copy link
Collaborator

aroben commented Mar 9, 2017

As I mentioned in #36 it'd be great to have some documentation for how to use SimpleCov with test-queue.

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

3 participants