apache / pekko-http

The Streaming-first HTTP server/module of Apache Pekko
https://pekko.apache.org/
Apache License 2.0
148 stars 34 forks source link

Add munit test framework #536

Closed Philippus closed 2 months ago

Philippus commented 3 months ago

Applying this PR will add support for testing routes with MUnit.

He-Pin commented 3 months ago

Thanks, but why a new test framework ?

pjfanning commented 3 months ago

I'd prefer not to add more dependencies to the main testkit. Could this go into a new testkit extension module? Something like pekko-http-testkit-munit.

mdedetrich commented 3 months ago

To me the issue is less about whether adding the dependency but more about whether the dependency itself is stable or not (talking about bincompat here).

If munit breaks fairly often, adding it to Pekko will create more problems then it solves

He-Pin commented 3 months ago

That true,scala gears has to self maintain a fork of munit.

laglangyue commented 3 months ago

Agree that this is an extension module

Philippus commented 3 months ago

To me the issue is less about whether adding the dependency but more about whether the dependency itself is stable or not (talking about bincompat here).

If munit breaks fairly often, adding it to Pekko will create more problems then it solves

The testkit doesn't guarantee binary compatibility: https://github.com/apache/pekko-http/blob/main/build.sbt#L225

Philippus commented 3 months ago

I'd prefer not to add more dependencies to the main testkit. Could this go into a new testkit extension module? Something like pekko-http-testkit-munit.

I'll rework the PR and do that.

Philippus commented 3 months ago

Thanks, but why a new test framework ?

This has been setting in our private repo for a while now, I thought it would be a nice addition. And afaics MUnit is gaining some traction.

Philippus commented 3 months ago

I separated it into a module, please let me know if it is ok like this.

pjfanning commented 2 months ago

Thanks @Philippus - merging

Would you have any interest in making a similar PR for main Pekko repo to add a pekko-testkit-munit? There are a few more testkits there too (streams, actor-typed, persistence).

Philippus commented 2 months ago

Thanks @Philippus - merging

Would you have any interest in making a similar PR for main Pekko repo to add a pekko-testkit-munit? There are a few more testkits there too (streams, actor-typed, persistence). And yes, I'm interested in making similar PR's for those.

There are more testkits, but I think only actor-typed and pekko-connectors-kafka have equivalent scalatest-specific functionality.

pjfanning commented 2 months ago

@Philippus It isn't strictly necessary but could you consider supplying an iCLA (if you haven't done so already)?

https://www.apache.org/licenses/contributor-agreements.html

pjfanning commented 2 months ago

Thanks @Philippus - your iCLA was received by the ASF Secretary.