-
Notifications
You must be signed in to change notification settings - Fork 30
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
Tests ARM, test case for ExtensionResource #701
Conversation
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/mockapi.ts
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/mockapi.ts
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/extension.tsp
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/mockapi.ts
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/mockapi.ts
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/extension.tsp
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/extension.tsp
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/mockapi.ts
Outdated
Show resolved
Hide resolved
packages/cadl-ranch-specs/http/azure/resource-manager/models/resources/extension.tsp
Outdated
Show resolved
Hide resolved
@@ -907,6 +907,156 @@ Expected response body: | |||
} | |||
``` | |||
|
|||
### Azure_ResourceManager_Models_Resources_ExtensionsResources_createOrUpdate | |||
|
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.
nit: do we need ExtensionsResources
, or is just Extensions
ok bc it's in the Resources
subspace
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.
Extension
is good.
Glad you brought it up. In fact, I revisited our existing ARM cases:
Some of them contain duplicate like this, and some not appropriate, e.g. ManagedIdentityTrackedResources
..
I've made a refactor PR to decouple SDK generated interface name with the scenarioName(it shouldn't affect existing generated SDKs):
#714
I had to use clientName
to achieve that, as @scenario("xx")
on the interface require extra mock tests for it.. Let me know if there are better solutions.
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.
Sorry I'm confused why you would need to use clientName
. Can you clarify what is failing / needing extra tests because that shouldn't be happening. Here's an example of a renaming pr, if that helps
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.
Fixed by commit 8ca02c5
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, it's mainly because that I don't want to break existing generated SDKs from current cadl-ranch. We already have several languages wrote test for generated code.
Wonder if there's better way to achieve that rather than @clientName
..
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.
In cases like these, we should go ahead and break. To do so, make sure everyone is aware of this issue, and that the PR has a minor version bump. Writing a mitigation guide (can just be a few lines: change x import to x import) is also very welcome.
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.
@iscai-msft May I know the concern of @clientName
? There's one more potential use case: #714 (comment)
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.
somehow I totally missed this comment, my bad. The concern is that we're using @clientName
to get around breaking cadl-ranch, and we're ok breaking cadl-ranch as long as everyone is aware. It adds technical debt and also makes the tests not as atomic: we aren't explicitly testing @clientName
here so we shouldn't be using it
ExtensionResource
#689Cadl Ranch Contribution Checklist:
@scenario
names. Someone can look at the list of scenarios and understand what I'm covering.@scenarioDoc
s for extra scenario description and to tell people how to pass my mock api check.