Personally, I would love to see EmbeddedKafkaCluster moved to a public test 
artifact, similarly to kafka-streams-test-utils. Having to copy/paste internal 
classes into your project is...unfortunate.


On Fri, 2019-12-06 at 10:42 -0600, John Roesler wrote:

[EXTERNAL EMAIL] Attention: This email was sent from outside TiVo. DO NOT CLICK 
any links or attachments unless you expected them.

________________________________



Hi Matthias!


Thanks for the note, and the kind sentiment.


We're always open to improvements like this, so your contribution would 
certainly be welcome.


Just FYI, "public interface" changes need to go through the KIP process (see 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FKAFKA%2FKafka%2BImprovement%2BProposals&data=02%7C01%7CThomas.Becker%40tivo.com%7C8c3fd9ab40da4062868008d77a6b615c%7Cd05b7c6912014c0db45d7f1dcc227e4d%7C1%7C0%7C637112473947272691&sdata=dsPBokqCBrydL8w%2FjLlj4pRfWCwmk%2B%2BQO2tTiKyoQAw%3D&reserved=0
 ). You could of course, open an exploratory PR and ask here for comments 
before deciding if you want to make a KIP, if you prefer. Personally, I often 
find it clarifying to put together a PR concurrently with the KIP, because it 
helps to flush out any "devils in the details", and also can help the KIP 
discussion.


Just wanted to make you aware of the process. I'm happy to help you navigate 
this process, by the way.


Regarding the specific proposal, the number one question in my mind is 
compatibility... I.e., do we add new dependencies, or change dependencies, that 
may conflict with what's already on users' classpaths? Would the change result 
in any source-code or binary incompatibility with previous versions? Etc... you 
get the idea.


We can make such changes, but it's a _lot_ easier to support doing it in a 
major release. Right now, that would be 3.0, which is not currently planned. 
We're currently working toward 2.5, and then 2.6, and so on, essentially 
waiting for a good reason to bump up to 3.0.


All that said, EmbeddedKafkaCluster is an interesting case, because it's not 
actually a public API!

When Bill wrote the book, he included it (I assume) because there was no other 
practical approach to testing available.

However, since the publication, we have added an official integration testing 
framework called TopologyTestDriver. When people ask me for testing advice, I 
tell them:

1. Use TopologyTestDriver (for Streams testing)

2. If you need a "real" broker for your test, then set up a pre/post 
integration test hook to run Kafka independently (e.g., with Maven).

3. If that's not practical, then _copy_ EmbeddedKafkaCluster into your own 
project, don't depend on an internal test artifact.


To me, this means that we essentially have free reign to make changes to 
EmbeddedKafkaCluster, since it _should_ only

be used for internal testing. In that case, I would just evaluate the merits up 
bumping all the tests in Apache Kafka up to JUnit 5. Although that's not a 
public API, it might be a big enough change to the process to justify a design 
document and project-wide discussion.


Well, I guess it turns out I had more to say than I initially thought... Sorry 
for rambling a bit.


What are your thoughts?

-John


On Fri, Dec 6, 2019, at 07:05, Matthias Merdes wrote:

>  Hi all,

>

> when reading ‘Kafka Streams in Action’ I especially enjoyed the

> thoughtful treatment of

> mocking, unit, and integration tests.

> Integration testing in the book (and in the Kafka codebase) is done

> using the @ClassRule-annotated EmbeddedKafkaCluster.

> JUnit 5 Jupiter replaced Rules with a different extension model.

> So my proposal would be to support a JUnit 5 Extension in addition to

> the JUnit 4 Rule for EmbeddedKafkaCluster

> to enable ’native’ integration in JUnit 5-based projects.

> Being a committer with the JUnit 5 team I would be happy to contribute

> a PR for such an extension.

> Please let me know if you are interested.

> Cheers,

> Matthias

>

>

>

>

>

>

>

>

>

>

> Matthias Merdes

> Senior Software Architect

>

>

>

> heidelpay GmbH

> Vangerowstraße 18

> 69115 Heidelberg

> -------------------------------------------------------------

> +49 6221 6471-692

> matthias.mer...@heidelpay.com<mailto:matthias.mer...@heidelpay.com>

> --------------------------------------------------------------

>

> Geschäftsführer: Dipl. Vw. Mirko Hüllemann,

> Tamara Huber, André Munk, Georg Schardt

> Registergericht: AG Mannheim, HRB 337681

>


--
[cid:c1b2c53556d0d0c1f6c3c6b2eb2d9d4801163ed8.camel@tivo.com] Tommy Becker
Principal Engineer
Personalized Content Discovery
O +1 919.460.4747
tivo.com<http://www.tivo.com/>

________________________________

This email and any attachments may contain confidential and privileged material 
for the sole use of the intended recipient. Any review, copying, or 
distribution of this email (or any attachments) by others is prohibited. If you 
are not the intended recipient, please contact the sender immediately and 
permanently delete this email and any attachments. No employee or agent of TiVo 
is authorized to conclude any binding agreement on behalf of TiVo by email. 
Binding agreements with TiVo may only be made by a signed written agreement.

Reply via email to