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

Cannot analyze response in aaz-dev-generated code #337

Open
Ptnan7 opened this issue Mar 20, 2024 · 1 comment
Open

Cannot analyze response in aaz-dev-generated code #337

Ptnan7 opened this issue Mar 20, 2024 · 1 comment

Comments

@Ptnan7
Copy link
Member

Ptnan7 commented Mar 20, 2024

I am migrating old cli to AAZ, but when I am running UT, there is an error:

E           azure.cli.testsdk.exceptions.JMESPathCheckAssertionError: Query 'deliveryPolicy.rules[1].conditions[0].parameters.matchType' doesn't yield expected value 'Wildcard', instead the actual value is 'None'. Data: 
E           {
E             "contentTypesToCompress": [],
E             "customDomains": [],
E             "deliveryPolicy": {
E               "description": "default_policy",
E               "rules": [
E                 {
E                   "actions": [
E                     {
E                       "name": "CacheExpiration",
E                       "parameters": {
E                         "cacheBehavior": "Override",
E                         "cacheDuration": "00:05:00",
E                         "cacheType": "All",
E                         "typeName": "DeliveryRuleCacheExpirationActionParameters"
E                       }
E                     }
E                   ],
E                   "conditions": [],
E                   "order": 0
E                 },
E                 {
E                   "actions": [
E                     {
E                       "name": "CacheExpiration",
E                       "parameters": {
E                         "cacheBehavior": "Override",
E                         "cacheDuration": "00:05:00",
E                         "cacheType": "All",
E                         "typeName": "DeliveryRuleCacheExpirationActionParameters"
E                       }
E                     }
E                   ],
E                   "conditions": [
E                     {
E                       "name": "UrlPath",
E                       "parameters": {
E                         "typeName": "DeliveryRuleUrlPathConditionParameters"
E                       }
E                     }
E                   ],
E                   "order": 1
E                 }
E               ]
E             },
E             "geoFilters": [],
E             "hostName": "endpointkewgalgzdqdgommi.azureedge.net",
E             "id": "/subscriptions/27cafca8-b9a4-4264-b399-45d0c9cca1ab/resourcegroups/clitest.rgxc2tgodwwnzgtbitsa4fj65fgukgms4ka4wifgodbqzlo3jj23he4mvap622qozgo/providers/Microsoft.Cdn/profiles/akpxtdyjskdyy22ocjaiehxi/endpoints/endpointkewgalgzdqdgommi",
E             "isCompressionEnabled": false,
E             "isHttpAllowed": true,
E             "isHttpsAllowed": true,
E             "location": "WestUs",
E             "name": "endpointkewgalgzdqdgommi",
E             "originGroups": [],
E             "origins": [
E               {
E                 "enabled": true,
E                 "hostName": "huaiyiztesthost1.blob.core.chinacloudapi.cn",
E                 "httpPort": 80,
E                 "httpsPort": 443,
E                 "name": "huaiyiztesthost1-blob-core-chinacloudapi-cn"
E               }
E             ],
E             "provisioningState": "Succeeded",
E             "queryStringCachingBehavior": "IgnoreQueryString",
E             "resourceGroup": "clitest.rgxc2tgodwwnzgtbitsa4fj65fgukgms4ka4wifgodbqzlo3jj23he4mvap622qozgo",
E             "resourceState": "Running",
E             "tags": {},
E             "type": "Microsoft.Cdn/profiles/endpoints"
E           }

However, I can see matchType in my response when I debug this cmd with launch.json, so I think there is some reason why aaz analyze failed in the field conditions.

The change I made: https://github.com/Ptnan7/azure-cli/blob/3a9a8b3cf2cd92e166da17f71b419001942ae52e/src/azure-cli/azure/cli/command_modules/cdn/custom/custom_cdn.py#L628

@Ptnan7
Copy link
Member Author

Ptnan7 commented Mar 20, 2024

And the log in external console:
[cli.knack.cli Command arguments 'c.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant