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

Setting quarkus.http.test-port to a non-default value breaks tests in MP OpenAPI TCK #4211

Closed
jmartisk opened this issue Sep 26, 2019 · 4 comments
Labels
area/testing kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@jmartisk
Copy link
Contributor

This is because the @BeforeSuite callback (https://github.com/eclipse/microprofile-open-api/blob/1.1.2/tck/src/main/java/org/eclipse/microprofile/openapi/tck/AppTestBase.java#L48) runs too early, before the TestHTTPResourceManager has a chance to set the test.url property, so the callback picks up the one that is passed from pom.xml, but that one has a hardcoded port 8081

@jmartisk jmartisk added kind/bug Something isn't working area/testing labels Sep 26, 2019
@jmartisk jmartisk changed the title Setting quarkus.http.test-port breaks tests in MP OpenAPI TCK Setting quarkus.http.test-port to a non-default value breaks tests in MP OpenAPI TCK Sep 26, 2019
@jmartisk
Copy link
Contributor Author

Options what we can do:

  • Change our Arquillian adapter and introduce a new BeforeSuite callback that runs before the one in the TCK and set a test.url property there based on the value of quarkus.http.test-port. However, the problem is that for test.url=0 (random port, introduced by Support random test port #4140), this will not work because at this point we don't know yet what the actual port will be, that is decided during boot of the container. And it is fragile because the property will later be overwritten by TestHTTPResourceManager#getUri
  • Change the TCK itself so that the test.url property is read later than in @BeforeSuite - moving it to @BeforeClass should do it I think, at that point the container is started and test.url is set correctly even if the port was random. We would also remove the test.url property from pom.xml, it will not be needed anymore.

I'd go with trying to change the tck if we want this fixed. What's your opinion @kenfinnigan ?

@kenfinnigan
Copy link
Member

I think changing the TCK makes the most sense.

I only added the test.url to the pom as it was the only way to get the TCK to pass at the time

@gastaldi
Copy link
Contributor

👍 to change the TCK.

@stuartwdouglas
Copy link
Member

Closing, as it sounds like this is no longer an issue.

@gsmet gsmet added the triage/out-of-date This issue/PR is no longer valid or relevant label Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

5 participants