Skip to content

better support for SimpleCov #35

@konk303

Description

@konk303

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.

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