smallrye / smallrye-open-api

SmallRye implementation of Eclipse MicroProfile OpenAPI
Apache License 2.0
118 stars 89 forks source link

Run junit TCK tests on non-8080 port #57

Closed EricWittmann closed 5 years ago

EricWittmann commented 5 years ago

The tests start up a server on port 8080. Instead, it should start the server on a random port and then use that. Otherwise it's very possible to collide with something else running on the machine.

msavy commented 5 years ago

On PTO today, but this piqued my interest. Wonder if using the reserve-network-port feature for build-helper-maven-plugin might be appropriate here?

https://www.mojohaus.org/build-helper-maven-plugin/reserve-network-port-mojo.html

It finds an unused port for you, which should help prevent collisions in most cases.

On 17 Dec 2018, at 13:14, Eric Wittmann notifications@github.com wrote:

The tests start up a server on port 8080. Instead, it should start the server on a random port and then use that. Otherwise it's very possible to collide with something else running on the machine.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/smallrye/smallrye-open-api/issues/57, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZ2WehOINKEDWOCD0QeX9Xvj-2A_Z4eks5u55ivgaJpZM4ZWVGI.

EricWittmann commented 5 years ago

Yeah that could work. Thanks for the tip.

msavy commented 5 years ago

I can do this one if you like

msavy commented 5 years ago

Okay, took a little longer than expected, but got it done. Turns out that there's a way to globally set the port in the client :-). The issue I initially hit is that there's no obvious way to override the DSL in AppTestBase#callEndpoint to set port in the normal way.

See #61