aaz-dev-tools icon indicating copy to clipboard operation
aaz-dev-tools copied to clipboard

Cannot analyze response in aaz-dev-generated code

Open Ptnan7 opened this issue 1 year ago • 1 comments

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 avatar Mar 20 '24 06:03 Ptnan7

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

Ptnan7 avatar Mar 20 '24 06:03 Ptnan7