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

Small OpenAPI and Swagger UI enhancements #19148

Merged
merged 5 commits into from
Aug 2, 2021
Merged

Small OpenAPI and Swagger UI enhancements #19148

merged 5 commits into from
Aug 2, 2021

Conversation

phillip-kruger
Copy link
Member

This PR contains some small enhancements to the OpenAPI and Swagger UI extensions:

Fix #18614
Fix #19113
Fix #19131

It might be easier to review per commit.

@phillip-kruger phillip-kruger requested a review from geoand August 1, 2021 04:52
@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/openapi area/smallrye area/swagger-ui labels Aug 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 1, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 07b1d7d

Status Name Step Test failures Logs Raw logs
JVM Tests - JDK 11 Build Test failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
JVM Tests - JDK 16 Build Test failures Logs Raw logs
Native Tests - Main Build Test failures Logs Raw logs
Native Tests - Misc4 Build Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 #

📦 extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment

io.quarkus.resteasy.reactive.server.test.simple.SimpleQuarkusRestTestCase.testWriter line 177 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.
Expected: "OK"
  Actual: An Internal Server Error with stack trace:
java.lang.NullPointerException
	at org.jboss.resteasy.reactive.server.injection.ContextProducers.getTarget(ContextProducers.java:108)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers.resourceInfo(ContextProducers.java:90)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.create(ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.zig:163)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.create(ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.zig:194)
	at io.quarkus.arc.impl.RequestContext.getIfActive(RequestContext.java:68)
	at io.quarkus.arc.impl.ClientP...

📦 integration-tests/main

io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON line 46 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <Generated API> but was: <main-integration-test API>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1124)
	at io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON(OpenApiTestCase.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java...

⚙️ JVM Tests - JDK 11 Windows #

📦 integration-tests/main

io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON line 46 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <Generated API> but was: <main-integration-test API>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1124)
	at io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON(OpenApiTestCase.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java...

⚙️ JVM Tests - JDK 16 #

📦 integration-tests/main

io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON line 46 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <Generated API> but was: <main-integration-test API>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1124)
	at io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON(OpenApiTestCase.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java...

⚙️ Native Tests - Main #

📦 integration-tests/main

io.quarkus.it.main.OpenApiITCase.testOpenAPIJSON - More details - Source on GitHub

org.opentest4j.AssertionFailedError: expected: <Generated API> but was: <main-integration-test API>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1124)
	at io.quarkus.it.main.OpenApiTestCase.testOpenAPIJSON(OpenApiTestCase.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
...

⚙️ Native Tests - Misc4 #

📦 integration-tests/gradle

io.quarkus.gradle.nativeimage.CustomNativeTestSourceSetIT.runNativeTests line 18 - More details - Source on GitHub

org.opentest4j.AssertionFailedError: 

expected: "SUCCESS"
 but was: null
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at io.quarkus.gradle.nativeimage.CustomNativeTestSourceSetIT.runNativeTests(CustomNativeTestSourceSetIT.java:18)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.engine....

@gsmet
Copy link
Member

gsmet commented Aug 1, 2021

@geoand the failure in io.quarkus.resteasy.reactive.server.test.simple.SimpleQuarkusRestTestCase.testWriter looks a bit suspicious.

@phillip-kruger
Copy link
Member Author

@gsmet @geoand yes, I need to fix those, the default name is now the app name and not Generated API anymore. The tests needs to be updated. I did not run the integration tests locally so I missed that. I'll update soon

@quarkus-bot
Copy link

quarkus-bot bot commented Aug 1, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 6671894

Status Name Step Test failures Logs Raw logs
MicroProfile TCKs Tests Verify Test failures Logs Raw logs

Full information is available in the Build summary check run.

Test Failures

⚙️ MicroProfile TCKs Tests #

📦 tcks/resteasy-reactive/target/testsuite/tests

com.sun.ts.tests.jaxrs.platform.container.completioncallback.JAXRSClient0164.argumentIsNullWhenRegistredClassTest line 208 - More details - Source on GitHub

com.sun.ts.tests.jaxrs.common.JAXRSCommonClient$Fault: Unexpected response content No name has been set yet expecting NULL
	at com.sun.ts.tests.jaxrs.platform.container.completioncallback.JAXRSClient0164.assertString(JAXRSClient0164.java:457)
	at com.sun.ts.tests.jaxrs.platform.container.completioncallback.JAXRSClient0164.argumentIsNullWhenRegistredClassTest(JAXRSClient0164.java:208)

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

Good stuff!

I only added a few minor comments. Also, can we the last commit be squashed into whatever commit introduced the broken tests?
That way we won't have intermediate state that doesn't build properly

@phillip-kruger
Copy link
Member Author

@geoand - thanks for the review, I'll make the changes as requested soon

Signed-off-by:Phillip Kruger <[email protected]>
OpenAPI auto add Security Requirement to endpoints with RolesAllowed
Signed-off-by:Phillip Kruger <[email protected]>
…sion

Signed-off-by:Phillip Kruger <[email protected]>
Fix OpenAPI integration tests
Signed-off-by:Phillip Kruger <[email protected]>
Signed-off-by:Phillip Kruger <[email protected]>
OpenAPI Allow multiple static files
Signed-off-by:Phillip Kruger <[email protected]>
@phillip-kruger phillip-kruger requested a review from geoand August 2, 2021 09:39
@phillip-kruger phillip-kruger added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 2, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 2, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 779dd5a

Status Name Step Test failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build Test failures Logs Raw logs
✔️ JVM Tests - JDK 16

Full information is available in the Build summary check run.

Test Failures

⚙️ JVM Tests - JDK 11 Windows #

📦 extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment

io.quarkus.resteasy.reactive.server.test.simple.SimpleQuarkusRestTestCase.testException line 170 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.
Expected: "OK"
  Actual: An Internal Server Error with stack trace:
java.lang.NullPointerException
	at org.jboss.resteasy.reactive.server.injection.ContextProducers.getTarget(ContextProducers.java:108)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers.resourceInfo(ContextProducers.java:90)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.create(ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.zig:163)
	at org.jboss.resteasy.reactive.server.injection.ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.create(ContextProducers_ProducerMethod_resourceInfo_be7f5503a87442251cde9fbc1d406fb350a529f0_Bean.zig:194)
	at io.quarkus.arc.impl.RequestContext.getIfActive(RequestContext.java:68)
	at io.quarkus.arc.impl.ClientP...

io.quarkus.resteasy.reactive.server.test.simple.SimpleQuarkusRestTestCase.testPrimitiveBody line 317 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:59)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.valid...

@phillip-kruger
Copy link
Member Author

@geoand @gsmet I am not sure if that failure is related, I do not think so. Can you check ?

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

I don't think they are, but best restart the tests to be sure

@phillip-kruger
Copy link
Member Author

Is it possible to only restart for JVM Tests - JDK 11 Windows ?

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

Unfortunately that's not possible

@quarkus-bot
Copy link

quarkus-bot bot commented Aug 2, 2021

Failing Jobs - Building 779dd5a

Status Name Step Test failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 16

@phillip-kruger
Copy link
Member Author

@geoand - any advice ?

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

What is failing?

@phillip-kruger
Copy link
Member Author

Not sure, seems likes it is timing out.

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

If it's not in a RESTEasy Reactive or OpenAPI related module, I wouldn't worry about it... The Windows build is pretty flaky...

@phillip-kruger
Copy link
Member Author

Should we just merge then ?

@geoand
Copy link
Contributor

geoand commented Aug 2, 2021

Yup, go ahead

@phillip-kruger
Copy link
Member Author

Thanks :)

@phillip-kruger phillip-kruger merged commit 95bcc1e into quarkusio:main Aug 2, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Aug 2, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 2, 2021
Sgitario added a commit to Sgitario/quarkus-test-suite that referenced this pull request Aug 3, 2021
Sgitario added a commit to quarkus-qe/quarkus-test-suite that referenced this pull request Aug 3, 2021
Sgitario added a commit to Sgitario/beefy-scenarios that referenced this pull request Aug 4, 2021
@phillip-kruger phillip-kruger deleted the swagger-ui-enhancements branch August 4, 2021 11:47
rsvoboda added a commit to rsvoboda/beefy-scenarios that referenced this pull request Aug 5, 2021
rsvoboda added a commit to rsvoboda/beefy-scenarios that referenced this pull request Aug 5, 2021
Sgitario pushed a commit to quarkus-qe/beefy-scenarios that referenced this pull request Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants