Giter Club home page Giter Club logo

Comments (4)

colszowka avatar colszowka commented on May 18, 2024

Thanks for the report. I'll have a look into it, though I can't come up with an easy solution right now.

from simplecov.

nbogie avatar nbogie commented on May 18, 2024

Hi, I've made a fix for this issue but it currently lacks automated tests:
https://github.com/nbogie/simplecov/commit/ec8bd54f9507204440665f51b34ee584d16516f4

In the manual test documented in the above issue, simplecov's at_exit() will be reached with $! populated with some exception other than SystemExit (specifically a RuntimeError). Simplecov was only calling exit explicitly if it found a SystemExit exception was present. I extended that to work for other exceptions. For some reason, the presence of $! was not anyway causing a non-zero exit, at least in the situation where the registered at_exit handler had to prepare a simplecov report. I haven't found good documentation on this aspect of ruby (pointers welcome).

I'm dubious of the existing approach of doing the reporting work (and of calling exit) from within an at_exit handler. Also, what happens if the report formatter raises an exception, given that it is also generally launched from this handler? Isn't there some other point at which to prepare the report rather than using the at_exit hook? I get that such a callback would likely be framework-dependent.

I've only glanced at the rest of the code; please excuse my ignorance.

Resources:

from simplecov.

colszowka avatar colszowka commented on May 18, 2024

I don't think there is a better way to capture the coverage results than with an at_exit handler - What other way could there be to let simplecov do it's thing when the test suite is finished?

Your commit makes a lot of sense to me, keeping this open so I remember to add tests and pull it in.

from simplecov.

colszowka avatar colszowka commented on May 18, 2024

This is included in the new 0.5.4 release, thanks a lot!

from simplecov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.