Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
33 stars 82 forks source link

[DPG] Full CADL-Ranch coverage #2057

Open lmazuel opened 1 year ago

lmazuel commented 1 year ago

Title is self explanatory :)

haolingdong-msft commented 1 year ago

Note: One blocker I can see to reach to 100% coverage is that some cases not applicable to specific language, like model Inheritance for .net and java, fixed enum putUnknown for java etc.

https://azure.github.io/cadl-ranch/

invalid cases for Java list: Case Reason
Models/Inheritance/Discriminated/putModel Polymorphic deserialization doesn't support multiple levels of inheritance in Jackson, https://github.com/FasterXML/jackson-databind/issues/1188
Models/Inheritance/Discriminated/getRecursiveModel Polymorphic deserialization doesn't support multiple levels of inheritance in Jackson, https://github.com/FasterXML/jackson-databind/issues/1188
Enums/Fixed/putUnknownValue Java does not allow passing unknown value to fixed enum, this will lead to compilation error
weidongxu-microsoft commented 1 year ago

Another is some wrong mockapi. e.g. I am still waiting this fix to be released to enable some tests https://github.com/Azure/cadl-ranch/pull/249

@haolingdong-msft But just start with things that works.

haolingdong-msft commented 1 year ago

Another is some wrong mockapi. e.g. I am still waiting this fix to be released to enable some tests Azure/cadl-ranch#249

@haolingdong-msft But just start with things that works.

of course, I will start on the workable ones. Just note this down in case forgot.

weidongxu-microsoft commented 1 year ago

@haolingdong-msft

Enums/Fixed/putUnknownValue

this is just compile error?

haolingdong-msft commented 1 year ago

@haolingdong-msft

Enums/Fixed/putUnknownValue

this is just compile error?

Yes, in other word, we just don't allow passing unkown value to fixed enum: https://github.com/Azure/autorest.java/blob/main/typespec-tests/src/test/java/com/enums/fixed/FixedClientTest.java#L26 Update above table a bit to make it more clear.

haolingdong-msft commented 1 year ago

Hi @XiaofeiCao, could you please try to add more cadl-ranch cases, https://azure.github.io/cadl-ranch/ this report shows the tests we don't supoprt yet.

resilliency one does not have correct mockapi yet, let's focus on others first.

Can be added:

Below ones can not be added now, these are not workable ones:

weidongxu-microsoft commented 1 year ago

@haolingdong-msft please be more specific, as you are familiar with this. Please just list the row that you want Xiaofei to help (and exclude things that known not work).

I know Dictionary -> NullableFloatValue does not work.


If you don't want to be specific, you can still take this. I've enough unassigned tasks in tsp. https://github.com/Azure/autorest.java/issues/2064 https://github.com/Azure/autorest.java/issues/2067 https://github.com/Azure/autorest.java/issues/2068

haolingdong-msft commented 1 year ago

@haolingdong-msft please be more specific, as you are familiar with this. Please just list the row that you want Xiaofei to help (and exclude things that known not work).

I know Dictionary -> NullableFloatValue does not work.

Update on my comment above.

haolingdong-msft commented 1 year ago

@weidongxu-microsoft These are in Not workable ones list.

weidongxu-microsoft commented 1 year ago

Ok, so we had more not workable than TODO...

Note that part of Models/Property/Nullable could also not work (as change included in that unreleased fix)

For Internal, anyone does this https://github.com/Azure/autorest.java/issues/2067 will add it.

XiaofeiCao commented 1 year ago

For Models/Property/Nullable, I'll wait for their release. Last release was 10 days ago.

I'll take Internal first.

weidongxu-microsoft commented 1 year ago

This one actually not have Java test https://github.com/Azure/cadl-ranch/tree/main/packages/cadl-ranch-specs/http/server/path

please wait for PR https://github.com/Azure/autorest.java/pull/2074, as cadl-ranch 0.11 changed some of it