-
Notifications
You must be signed in to change notification settings - Fork 551
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
at_exit
block not executed?
#685
Comments
How are you running your tests? fwiw, Minitest autorun starts in an at_exit block so working with SimpleCov is always going to be a little weird and load-order dependent. I came across this quite a bit in ActiveModelSerializers |
Yes knowing how you run them or a code example might help track this down :) |
I am using Minitest to run the tests, yes. Even if I remove all formatters to only leave the HTML Formatter, the report is not generated :( |
what's the order in which you require minitest vs. simplecov? You need to require simplecov first, I believe. See a situation where I've wrangled with this in the past (unrelated to simplecov) to force minitest to run in the |
I require |
Where is this and can I help at all? I'm experiencing this too. Point me at the relevant code on the simplecov side? |
Looks like at_exit do
# If we are in a different process than called start, don't interfere.
next if SimpleCov.pid != Process.pid
SimpleCov.set_exit_exception
SimpleCov.run_exit_tasks!
end In particular, Also, the test identifier uses |
I got it working and basically did this: at_exit do
if defined? Minitest then
Minitest.after_run do
simplecov_at_exit
end
else
simplecov_at_exit
end
end
def simplecov_at_exit
# If we are in a different process than called start, don't interfere.
return if SimpleCov.pid != Process.pid
SimpleCov.set_exit_exception
SimpleCov.run_exit_tasks!
end |
This is being fixed in #756 |
(related to simplecov-ruby/simplecov-html#62)
My custom
SimpleCov.at_exit
block is not executed in my test suite, and the default one seems to be ignored also (the html report is not generated after the test suite finished).I am using:
simplecov-0.16.1
simplecov-html-0.10.2
In the
test_helper.rb
, I have:And my
.simplecov
file contains:I tried with simple
SimpleCov.at_exit { puts "hello world" }
or evenSimpleCov.at_exit { 1/0 }
(to trigger an error), but the block is not executed. What am I doing wrong here? Did I miss something?The text was updated successfully, but these errors were encountered: