Add unit tests and sensible coverage #12
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds some unit-tests around parsing different events into JSON and abnormal behaviour of socket or corrupted events.
Tests can be run using
sbt test
.Tests with coverage can be run using
sbt coverage test coverageReport
.I am not sure if there is a CI for repo, but it would be good to include tests.
Here is the summary for this patch:
[info] Total number of tests run: 17 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 17, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. ... [info] Statement coverage.: 89.62% [info] Branch coverage....: 80.00% [info] Coverage reports completed [info] Coverage is above minimum [89.62% > 80.0%] [info] All done. Coverage was [89.62%]
Though It is not great coverage and tests, I hope checks will help with migrating to different Spark versions.