Skip to content

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

Merged
PragTob merged 3 commits into
masterfrom
cshaffer-fix-parallel-builds
Jan 26, 2017
Merged

PragTob merged 3 commits into
masterfrom
cshaffer-fix-parallel-builds

Conversation

@PragTob

@PragTob PragTob commented Jan 25, 2017 •

Copy link
Copy Markdown
Collaborator

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.

@PragTob PragTob left a comment

Copy link
Copy Markdown
Collaborator Author

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 :)

Comment thread spec/last_run_spec.rb Outdated

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

Copy link
Copy Markdown
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 :)

Comment thread spec/last_run_spec.rb Outdated
end
end
end
end if SimpleCov.usable?

Copy link
Copy Markdown
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