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

Allow for empty last_run files for parallel tests by cschaffer #549

Merged
merged 3 commits into from
Jan 26, 2017

Conversation

PragTob
Copy link
Collaborator

@PragTob PragTob commented Jan 25, 2017

I took the liberty to merge the #533 of @cshaffer to resolve the merge conflict. Sorry that it took some time!

Original text:

Fixes #410
When running tests in parallel using parallel_tests and parallel_tests-fine_grain_test sometimes one thread will be completely starved from running any tests which results in an empty last_run json file which blows up when collecting all the results. This PR makes it so we don't try to parse an empty string as json and instead return nil as if the file wasn't there at all.

Since there were no tests for SimpleCov::LastRun I took the liberty of writing tests for everything including the change I made.

Copy link
Collaborator Author

@PragTob PragTob left a comment

Choose a reason for hiding this comment

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

Looks good overall, just some minor things :)


it "writes json to its last_run_path" do
json = []
subject.write(json)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm I'd prefer some actual JSON here :)

end
end
end
end if SimpleCov.usable?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess rubocop will complain here/we changed those up, easy fix :)

@PragTob PragTob merged commit b432e24 into master Jan 26, 2017
@PragTob PragTob deleted the cshaffer-fix-parallel-builds branch January 16, 2020 12:13
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.

MultiJson::ParseError when running with parallel_tests
1 participant