Skip to content

lfs/batcher: introduce test cases#613

Merged
technoweenie merged 3 commits intogit-lfs:masterfrom
ttaylorr:batcher-test-cases
Aug 27, 2015
Merged

lfs/batcher: introduce test cases#613
technoweenie merged 3 commits intogit-lfs:masterfrom
ttaylorr:batcher-test-cases

Conversation

@ttaylorr
Copy link
Contributor

This commit adds the notion of a test case into the lfs.Batcher tests. Each
test case has three parameters: a batch size, the number of items to add to that
batcher, and whether or not it should exit the batcher after adding all items.

This commit also adds a helper func called assertAll which processes a set of
test cases, throwing assertion errors into the *testing.T along the way.

On the other hand, this commit does not contain any utilities to assert that a
deadlock will occur when feeding items into a Batcher, i.e., when the batch size
is set to 0.

This commit adds the notion of a test case into the `lfs.Batcher` tests. Each
test case has three properties:
  - the batch size
  - the number of batched items
  - whether or not the batcher should exit

This commit also adds a helper func called `assertAll` which processes a set of
test cases, throwing assertion errors into the `*testing.T` along the way.

On the other hand, this commit does not contain any utilities to assert that a
deadlock will occur when feeding items into a Batcher, i.e., when the batch size
is set to 0.
@ttaylorr ttaylorr force-pushed the batcher-test-cases branch from 834d719 to 4a41bf1 Compare August 27, 2015 20:40
Copy link
Contributor

Choose a reason for hiding this comment

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

Go comments for types and funcs start with the name. The only godoc comments that have a prefix are package comments. https://golang.org/doc/effective_go.html#commentary

@ttaylorr
Copy link
Contributor Author

Thanks for the suggestions, @technoweenie. I've pushed commits to address both of your comments.

@technoweenie
Copy link
Contributor

Thanks for the tests!

technoweenie added a commit that referenced this pull request Aug 27, 2015
lfs/batcher: introduce test cases
@technoweenie technoweenie merged commit 5d4b5cf into git-lfs:master Aug 27, 2015

Choose a reason for hiding this comment

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

nit: typo, should be "returns"

Copy link
Contributor

Choose a reason for hiding this comment

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

Doh! 3f1eec2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for fixing that! Totally missed it.

@ttaylorr
Copy link
Contributor Author

Thanks for the review @technoweenie, @WillHipschman!

@ttaylorr ttaylorr deleted the batcher-test-cases branch August 27, 2015 21:54
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