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

Make KPL consumers more testable #136

Merged
merged 1 commit into from
Nov 13, 2017
Merged

Conversation

JeffAtDeere
Copy link
Contributor

@JeffAtDeere JeffAtDeere commented Sep 14, 2017

Introduced interface on KinesisProducer for testability/mockability.
Introduced UserRecord object and KinesisProducer.addUserRecord(UserRecord) method.

@pfifer

This commit was done with 100% backwards compatibility in mind.

Introduced UserRecord object and KinesisProducer.addUserRecord(UserRecord) method.
@pfifer
Copy link
Contributor

pfifer commented Sep 15, 2017

Is the testing goal for increase unit testing in the KPL, or for your own unit testing?

My feeling is that if it's for the KPL the private constructors should be package private. If it's for your own testing public makes more sense.

@JeffAtDeere
Copy link
Contributor Author

Excellent question. This is for testing of my things that use KPL. The private constructors mean I can't make instances nor can I mock over them.

@JeffAtDeere
Copy link
Contributor Author

Similar reasoning for the interface on KinesisProducer -- KinesisProducers no arg constructor tries (via another constructor) to extractBinaries() which fails on windows, meaning I can't mock over or make new instances of KinesisProducer on a windows machine. With an interface, even on Linux (where binaries are available) the mock won't start the child daemon.

@JeffAtDeere
Copy link
Contributor Author

JeffAtDeere commented Sep 18, 2017

@pfifer does that make sense? If so, can you merge this or let me know if any changes are required? Thank you.

@pfifer
Copy link
Contributor

pfifer commented Sep 26, 2017

Yes it makes sense. I'm currently in the process of planning, and preparing a release. I will have an update hopefully later this week.

@pfifer
Copy link
Contributor

pfifer commented Oct 3, 2017

Please confirm that we can use, modify, copy, and redistribute this contribution. Thanks.

@JeffAtDeere
Copy link
Contributor Author

I checked and can confirm.

@pfifer pfifer merged commit a73efe7 into awslabs:master Nov 13, 2017
@JeffAtDeere JeffAtDeere deleted the make_testable branch November 13, 2017 15:11
@pfifer pfifer added this to the v0.12.6 milestone Nov 13, 2017
pfifer added a commit to pfifer/amazon-kinesis-producer that referenced this pull request Nov 14, 2017
* Added Windows support
  The 0.12.x version now supports Windows.
  The Windows version is currently mastered on the branch `windows`, which will be merged at a later date.
  The build instructions for Windows are currently out of date, and will be updated at a later date.__
  * Issue awslabs#113
  * Issue awslabs#74
  * Issue awslabs#73
* Removed the libc wrapper
  The libc wrapper lowered the required version of glibc.  The KPL is now built with an older version of libc, which removes the need for the wrapper.
  * PR awslabs#139
* Set the minimum required version of macOS to 10.9.
  The KPL is now built against macOS 10.9.
  * Issue awslabs#117
  * PR awslabs#138

* Allow exceptions to bubble to the thread exception handler for Daemon threads.
  Exceptions that occur on daemon threads will now be allowed to propagate to the thread exception handler.  This doesn't provide any additional monitoring or handling of thread death.
  * PR awslabs#112
  * Issue awslabs#111
* Updated `amazon-kinesis-producer-sample` to use the correct properties in its configuration file.
  * PR awslabs#120
  * Issue awslabs#119
* Updated documentation of `AggregationMaxSize` to match actual Kinesis limits.
  * PR awslabs#133
* Added support for setting `ThreadingModel`, and `ThreadPoolSize` using a properties file.
  * PR awslabs#134
  * Issue awslabs#124
* Extracted `IKinesisProducer` from `KinesisProducer` to allow for easier testing.
  * PR awslabs#136
pfifer added a commit that referenced this pull request Nov 14, 2017
* Added Windows support
  The 0.12.x version now supports Windows.
  The Windows version is currently mastered on the branch `windows`, which will be merged at a later date.
  The build instructions for Windows are currently out of date, and will be updated at a later date.__
  * Issue #113
  * Issue #74
  * Issue #73
* Removed the libc wrapper
  The libc wrapper lowered the required version of glibc.  The KPL is now built with an older version of libc, which removes the need for the wrapper.
  * PR #139
* Set the minimum required version of macOS to 10.9.
  The KPL is now built against macOS 10.9.
  * Issue #117
  * PR #138

* Allow exceptions to bubble to the thread exception handler for Daemon threads.
  Exceptions that occur on daemon threads will now be allowed to propagate to the thread exception handler.  This doesn't provide any additional monitoring or handling of thread death.
  * PR #112
  * Issue #111
* Updated `amazon-kinesis-producer-sample` to use the correct properties in its configuration file.
  * PR #120
  * Issue #119
* Updated documentation of `AggregationMaxSize` to match actual Kinesis limits.
  * PR #133
* Added support for setting `ThreadingModel`, and `ThreadPoolSize` using a properties file.
  * PR #134
  * Issue #124
* Extracted `IKinesisProducer` from `KinesisProducer` to allow for easier testing.
  * PR #136
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.

2 participants