-
Notifications
You must be signed in to change notification settings - Fork 34
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
Test coverage for ensuring the MessageBodyWriter is used with null Accept header #1949
Test coverage for ensuring the MessageBodyWriter is used with null Accept header #1949
Conversation
fa67b16
to
58624c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for coverage. I have some comments and suggestion.
.../http-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/YamlProvider.java
Outdated
Show resolved
Hide resolved
...tp-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/HeadersResource.java
Show resolved
Hide resolved
http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/main/java/io/quarkus/ts/http/advanced/HeadersMessageBodyWriter.java
Outdated
Show resolved
Hide resolved
...ed-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/HeadersMessageBodyWriter.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of coverage like this?
Upstream has completely same Quarkus REST tests, don't you trust upstream CI that has to pass or do you expect something specific for a product? I don't think we should mirror every test in upstream. @fedinskiy do we really need to test this? Cannot you use upstream test coverage label?
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
Please improve PR title, it will take just a few seconds to make clear what 41411 is. Thank you |
@michalvavrik the point is to verify the upstream backports for 3.8.6, and when I do that I try to create some test coverage in our TS, verify some corner cases(RestEasy), etc, but you are right if these tests are already in upstream tests, I don't want duplicity. |
Yeah @jcarranzan , your work is alright. The reason why I am asking @fedinskiy (responsible for this release) is that I would simply replace this with JIRA label. Because there are some backports that is alright not to test. So I cannot let what's next, all my comments are rather opinions, you don't need to follow them :-) |
Anyway @jcarranzan @jedla97 feel free to proceed with this PR, I don't mean to obstruct. |
@michalvavrik just in case: this task is related to 3.8.6, and I am responsible for 3.15 :) |
damn! |
In that case I'll leave this to @jcarranzan and @jedla97 and move to my tasks. |
1adbf8c
to
c069169
Compare
f0fde39
to
a1ed08a
Compare
Issue created: quarkusio/quarkus#42854 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcarranzan Thanks for update. In overall it's look good to me. Just have 2 suggestion and also unresolve the thread about that logging with question.
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
...tp-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/HeadersResource.java
Outdated
Show resolved
Hide resolved
Also looking at the test and it seems that |
471377b
to
d3e7a96
Compare
Fixed!, thanks @jedla97 . |
c31c109
to
26de7b5
Compare
0079f9e
to
91db874
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jcarranzan I'm looking at this and don't like that this message header writer affecting other test and resources.
I looked at it and proposing solution.
That MessageBodyWriter<String>
won't be catching a modify the all String
responses but you will create new class (your own datatype) and it will be modified only the response types of this class. So the implementation will be something like MessageBodyWriter<MySimpleClass>
.
What I have looked it's valid usecase + you will have different test then is covered in upstream as bonus. I'll leave the implementation details on you. Just FYI I tried it with simple class and it worked.
Also when we use this implementation we don't need separate test class just for this one test (save few minutes when executing native 😄)
57b83d5
to
9731967
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at proposed solution! I have few small comments .
Also I see that you checked the Backport
in Pr description. This point is used when you backorting something to different branch.
Looking at HeadersIT
the it's run on openshift OpenShiftHeadersIT
so the This change requires execution against OCP (use run tests phrase in comment)
point should be checked to not merge this before we run ocp tests
...tp-advanced-reactive/src/main/java/io/quarkus/ts/http/advanced/reactive/HeadersResource.java
Outdated
Show resolved
Hide resolved
...-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/BaseHttpAdvancedReactiveIT.java
Outdated
Show resolved
Hide resolved
...ive/src/test/java/io/quarkus/ts/http/advanced/reactive/DevModeGrpcIntegrationReactiveIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced-reactive/src/test/java/io/quarkus/ts/http/advanced/reactive/HeadersIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/BaseHttpAdvancedIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/DevModeGrpcIntegrationIT.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/main/java/io/quarkus/ts/http/advanced/HeadersResource.java
Outdated
Show resolved
Hide resolved
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Show resolved
Hide resolved
9bc2d17
to
c23d6a9
Compare
run tests |
@michalvavrik can you do a review as I was finished this PR. |
@@ -93,6 +96,19 @@ void testPathSpecificHeaderRulesOrder() { | |||
cacheControlMatches(response, "max-age=1"); | |||
} | |||
|
|||
@Test | |||
@Tag("https://github.com/quarkusio/quarkus/pull/41411") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refuse to believe that PR only changing independent RESTEasy Reactive library has to be tested in the RESTEasy Classic. They are completely independent implementations.
If you mean to test that same issue is not present in the RESTEasy Classic, I can respect that (though I would not), but I would not link the PR. Maybe link the issue and add comment that this is not reproducing, just verifying it is not there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm for having the same test in RESTEasy Classic to ensure the same behavior in this case.
+1 to have just comment as @michalvavrik suggested, that coverage is inspired by the issue, but it's not reproducing it on classic side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I was thinking yesterday if I should remove this classic coverage. Your reasoning make sense so I remove it.
@jcarranzan if you still think that we should test even the rest classic please create PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh now I read @rsvoboda comment so I will update it back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back + changed to use original issue in comment
8d08dd1
to
3a3e9cb
Compare
http/http-advanced/src/test/java/io/quarkus/ts/http/advanced/HeadersIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job well done @jedla97 .
3a3e9cb
to
5973827
Compare
Summary
Coverage for backports 3.8.6 --> quarkusio/quarkus#41411 - Ensure that MessageBodyWriter is passed the proper media type.
Verify that currently , it works with
quarkus-rest
Notice this was failing with quarkus version:
mvn clean verify -Dquarkus.platform.version=3.11.2 -Dit.test=HeadersIT#testWithNoAcceptHeader -Dreruns=0
Also, I noticed that the fix is not working with
quarkus-resteasy
,I'll open a bug related to.Please select the relevant options.
run tests
phrase in comment)Checklist: