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

Exit status refactoring & differentiate originator of failign exit code #906

Merged
merged 9 commits into from Aug 12, 2020

Conversation

PragTob
Copy link
Collaborator

@PragTob PragTob commented Aug 9, 2020

Basically a semi precursor to reviving #739 as I didn't want to meddle with this code.

Individual commits have more information.

This method was giant spaghetti, that was hard to maintain and
fix stuff in.

The new solution might seem overblown but with it's current
interdependencies was the best I could come up with.

Decided to decouple it a bit from asking SimpleCov itself for
the coverage values to make it easier to test in isolation. No
tests added as of right now though since it's tested quite a bit.

The strategy to put each check into its own class produces more
lines of code but makes their intent clearer and also makes it
easier to figure out what belongs to what check.
Don't have to pull the value through basically everything. Also,
for us that's quite the important concept to have centralized.

I'm not a fan of where it lives right now, but might come up
with something new and better.
Makes it easier to follow the code and there's no magic runnign
there. Also makes our interface smaller.
Refactoring this part made it clearer that all the different
checks against success weren't necessary and could be done on
a higher level removing lots and lots of branches on the lower
level all checking for the same thing.

Also implements the feature that we print different error
messages for aborting on "we want to throw an error" vs.
"we determined there was an error before".

Decided to print out both in case we have a false positive then
people can file better error reports of "you said there was
an error before, but there wasn't!"

Also deleted some tests as they dealt with cases that don't
happen anymore/don't have to be checked anymore. Added some cukes
to show that we say something else went wrong.

Test suit holds up. Let's hope this won't be another billion
fixes for minute details I forgot about and need to fix after
the next release!
@PragTob PragTob changed the title Exit status refactoring Exit status refactoring & differentiate originator of failign exit code Aug 11, 2020
When I accidentally fixed something, I hope I didn't accidentally
break things.
@PragTob
Copy link
Collaborator Author

PragTob commented Aug 12, 2020

Alright, merging. There are still some things left to do around parallel tests but I'll do that in a separate PR.

@PragTob PragTob merged commit ee17c98 into master Aug 12, 2020
@PragTob PragTob deleted the exit-status-refactoring branch August 12, 2020 12:25
@joshuapinter
Copy link
Contributor

Whoop! 🕺

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.

None yet

2 participants