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

Add method to shutdown and collect results before at_exit #731

Closed
wants to merge 7 commits into from

Conversation

macumber
Copy link
Contributor

We are using simplecov as part of a testing framework and have need to collect results before at_exit. The new end_now method allows the user to get results before at_exit.

@macumber
Copy link
Contributor Author

@colszowka I can add a test for this new method, wanted to check if you were ok with the general premise first though

@PragTob
Copy link
Collaborator

PragTob commented Jul 20, 2019

👋

Hi there,

sorry for the delay I've been rather busy :) What's you use case if I might ask? It's rather specific. To understand if there'd be a better way to do this/accomplish this I need to understand the use case.

SimpleCov.set_exit_exception
exit_status = SimpleCov.exit_status_from_exception
SimpleCov.result.format!
exit_status = SimpleCov.process_result(SimpleCov.result, exit_status)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SimpleCov should be self here so no need to address it directly imo. Also I think the last assignment and return aren't needed :)

@@ -53,6 +53,17 @@ def start(profile = nil, &block)
Coverage.start
end

#
# Method added by NREL to shutdown SimpleCov and collect results
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is NREL?

@PragTob
Copy link
Collaborator

PragTob commented Dec 3, 2019

@macumber Hi there! 👋 Any plans on picking this up or detailing your use case for this? Would be really helpful! :)

@deivid-rodriguez
Copy link
Collaborator

Closing this because it's being included in #780. @macumber the linked PR achieves the same thing you were looking for here. Only difference is that the "early exit method" is called SimpleCov.run_exit_tasks!, not SimpleCov.end_now.

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

Successfully merging this pull request may close these issues.

3 participants