Skip to content

Commit

Permalink
Extension Regression Test for mesh (#5711)
Browse files Browse the repository at this point in the history
  • Loading branch information
azclibot authored Jan 12, 2023
1 parent f1ec261 commit 1799f82
Show file tree
Hide file tree
Showing 3 changed files with 426 additions and 0 deletions.
142 changes: 142 additions & 0 deletions src/mesh/azext_mesh/tests/latest/recordings/test_app_commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
interactions:
- request:
body: '{"properties": {"template": {"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "metadata":
{"description": "Location of the resources."}, "defaultValue": "eastus"}}, "resources":
[{"apiVersion": "2018-07-01-preview", "name": "helloWorldNetwork", "type": "Microsoft.ServiceFabricMesh/networks",
"location": "[parameters(''location'')]", "dependsOn": [], "properties": {"addressPrefix":
"10.0.0.4/22", "ingressConfig": {"layer4": [{"name": "helloWorldIngress", "publicPort":
"80", "applicationName": "helloWorldApp", "serviceName": "helloWorldService",
"endpointName": "helloWorldListener"}]}}}, {"apiVersion": "2018-07-01-preview",
"name": "helloWorldApp", "type": "Microsoft.ServiceFabricMesh/applications",
"location": "[parameters(''location'')]", "dependsOn": ["Microsoft.ServiceFabricMesh/networks/helloWorldNetwork"],
"properties": {"description": "Service Fabric Mesh HelloWorld Application!",
"services": [{"type": "Microsoft.ServiceFabricMesh/services", "location": "[parameters(''location'')]",
"name": "helloWorldService", "properties": {"description": "Service Fabric Mesh
Hello World Service.", "osType": "linux", "codePackages": [{"name": "helloWorldCode",
"image": "seabreeze/azure-mesh-helloworld:1.1-alpine", "endpoints": [{"name":
"helloWorldListener", "port": "80"}], "resources": {"requests": {"cpu": "1",
"memoryInGB": "1"}}}, {"name": "helloWorldSideCar", "image": "seabreeze/azure-mesh-helloworld-sidecar:1.0-alpine",
"resources": {"requests": {"cpu": "1", "memoryInGB": "1"}}}], "replicaCount":
"1", "networkRefs": [{"name": "[resourceId(''Microsoft.ServiceFabricMesh/networks'',
''helloWorldNetwork'')]"}]}}]}}]}, "mode": "incremental"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- mesh deployment create
Connection:
- keep-alive
Content-Length:
- '1776'
Content-Type:
- application/json
ParameterSetName:
- -g --template-file --name
User-Agent:
- AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.8 (Linux-5.15.0-1023-azure-x86_64-with-glibc2.31)
VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Resources/deployments/cli000002","name":"cli000002","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12162830685734536881","parameters":{"location":{"type":"String","value":"eastus"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-01-03T03:45:43.5541163Z","duration":"PT0.000779S","correlationId":"5008263b-573b-4c63-93f6-cc5f1eeddf9c","providers":[{"namespace":"Microsoft.ServiceFabricMesh","resourceTypes":[{"resourceType":"networks","locations":["eastus"]},{"resourceType":"applications","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.ServiceFabricMesh/networks/helloWorldNetwork","resourceType":"Microsoft.ServiceFabricMesh/networks","resourceName":"helloWorldNetwork"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.ServiceFabricMesh/applications/helloWorldApp","resourceType":"Microsoft.ServiceFabricMesh/applications","resourceName":"helloWorldApp"}]}}'
headers:
azure-asyncoperation:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/cli000002/operationStatuses/08585288893427514852?api-version=2021-04-01
cache-control:
- no-cache
content-length:
- '1200'
content-type:
- application/json; charset=utf-8
date:
- Tue, 03 Jan 2023 03:45:43 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1198'
status:
code: 201
message: Created
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
CommandName:
- mesh deployment create
Connection:
- keep-alive
ParameterSetName:
- -g --template-file --name
User-Agent:
- AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.8 (Linux-5.15.0-1023-azure-x86_64-with-glibc2.31)
VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585288893427514852?api-version=2021-04-01
response:
body:
string: '{"status":"Failed","error":{"code":"DeploymentFailed","message":"At
least one resource deployment operation failed. Please list deployment operations
for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\":
{\r\n \"code\": \"UnsupportedProperty\",\r\n \"message\": \"Property:
.properties.services[].location is not supported.\",\r\n \"details\": [\r\n {\r\n \"code\":
\"Exception\",\r\n \"message\": \"Microsoft.ServiceFabric.Rp.Errors.WrpException:
Property: .properties.services[].location is not supported.\\r\\n at Microsoft.ServiceFabric.Rp.Model.Public.ExternalApiEntityValidator.Validate(String
schema, IEnumerable`1 additionalPropertiesPaths, IEnumerable`1 apiVersions)\\r\\n at
Microsoft.ServiceFabric.Rp.Common.WrpJsonFormatter.<>c__DisplayClass8_0.<ReadFromStreamAsync>b__0()\\r\\n at
System.Threading.Tasks.Task`1.InnerInvoke()\\r\\n at System.Threading.Tasks.Task.Execute()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Net.Http.HttpContentExtensions.<ReadAsAsyncCore>d__17`1.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.ModelBinding.FormatterParameterBinding.<ExecuteBindingAsyncCore>d__18.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.HttpActionBinding.<ExecuteBindingAsyncCore>d__12.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\"\r\n }\r\n ]\r\n }\r\n}"}]}}'
headers:
cache-control:
- no-cache
content-length:
- '2823'
content-type:
- application/json; charset=utf-8
date:
- Tue, 03 Jan 2023 03:46:14 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
status:
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
interactions:
- request:
body: '{"properties": {"template": {"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0", "parameters": {"location": {"type": "string", "metadata":
{"description": "Location of the resources."}, "defaultValue": "eastus"}}, "resources":
[{"apiVersion": "2018-07-01-preview", "name": "helloWorldNetwork", "type": "Microsoft.ServiceFabricMesh/networks",
"location": "[parameters(''location'')]", "dependsOn": [], "properties": {"addressPrefix":
"10.0.0.4/22", "ingressConfig": {"layer4": [{"name": "helloWorldIngress", "publicPort":
"80", "applicationName": "helloWorldApp", "serviceName": "helloWorldService",
"endpointName": "helloWorldListener"}]}}}, {"apiVersion": "2018-07-01-preview",
"name": "helloWorldApp", "type": "Microsoft.ServiceFabricMesh/applications",
"location": "[parameters(''location'')]", "dependsOn": ["Microsoft.ServiceFabricMesh/networks/helloWorldNetwork"],
"properties": {"description": "Service Fabric Mesh HelloWorld Application!",
"services": [{"type": "Microsoft.ServiceFabricMesh/services", "location": "[parameters(''location'')]",
"name": "helloWorldService", "properties": {"description": "Service Fabric Mesh
Hello World Service.", "osType": "linux", "codePackages": [{"name": "helloWorldCode",
"image": "seabreeze/azure-mesh-helloworld:1.1-alpine", "endpoints": [{"name":
"helloWorldListener", "port": "80"}], "resources": {"requests": {"cpu": "1",
"memoryInGB": "1"}}}, {"name": "helloWorldSideCar", "image": "seabreeze/azure-mesh-helloworld-sidecar:1.0-alpine",
"resources": {"requests": {"cpu": "1", "memoryInGB": "1"}}}], "replicaCount":
"1", "networkRefs": [{"name": "[resourceId(''Microsoft.ServiceFabricMesh/networks'',
''helloWorldNetwork'')]"}]}}]}}]}, "mode": "incremental"}}'
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
CommandName:
- mesh deployment create
Connection:
- keep-alive
Content-Length:
- '1776'
Content-Type:
- application/json
ParameterSetName:
- -g --template-file --name
User-Agent:
- AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.8 (Linux-5.15.0-1023-azure-x86_64-with-glibc2.31)
VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2021-04-01
response:
body:
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Resources/deployments/cli000002","name":"cli000002","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12162830685734536881","parameters":{"location":{"type":"String","value":"eastus"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-01-03T03:46:20.1574678Z","duration":"PT0.0005144S","correlationId":"66feafa7-5160-4c3e-a683-d7c543ee707c","providers":[{"namespace":"Microsoft.ServiceFabricMesh","resourceTypes":[{"resourceType":"networks","locations":["eastus"]},{"resourceType":"applications","locations":["eastus"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.ServiceFabricMesh/networks/helloWorldNetwork","resourceType":"Microsoft.ServiceFabricMesh/networks","resourceName":"helloWorldNetwork"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.ServiceFabricMesh/applications/helloWorldApp","resourceType":"Microsoft.ServiceFabricMesh/applications","resourceName":"helloWorldApp"}]}}'
headers:
azure-asyncoperation:
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/cli000002/operationStatuses/08585288893059497061?api-version=2021-04-01
cache-control:
- no-cache
content-length:
- '1201'
content-type:
- application/json; charset=utf-8
date:
- Tue, 03 Jan 2023 03:46:20 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-subscription-writes:
- '1199'
status:
code: 201
message: Created
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
CommandName:
- mesh deployment create
Connection:
- keep-alive
ParameterSetName:
- -g --template-file --name
User-Agent:
- AZURECLI/2.43.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.8 (Linux-5.15.0-1023-azure-x86_64-with-glibc2.31)
VSTS_7b238909-6802-4b65-b90d-184bca47f458_build_261_0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585288893059497061?api-version=2021-04-01
response:
body:
string: '{"status":"Failed","error":{"code":"DeploymentFailed","message":"At
least one resource deployment operation failed. Please list deployment operations
for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\":
{\r\n \"code\": \"UnsupportedProperty\",\r\n \"message\": \"Property:
.properties.services[].location is not supported.\",\r\n \"details\": [\r\n {\r\n \"code\":
\"Exception\",\r\n \"message\": \"Microsoft.ServiceFabric.Rp.Errors.WrpException:
Property: .properties.services[].location is not supported.\\r\\n at Microsoft.ServiceFabric.Rp.Model.Public.ExternalApiEntityValidator.Validate(String
schema, IEnumerable`1 additionalPropertiesPaths, IEnumerable`1 apiVersions)\\r\\n at
Microsoft.ServiceFabric.Rp.Common.WrpJsonFormatter.<>c__DisplayClass8_0.<ReadFromStreamAsync>b__0()\\r\\n at
System.Threading.Tasks.Task`1.InnerInvoke()\\r\\n at System.Threading.Tasks.Task.Execute()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Net.Http.HttpContentExtensions.<ReadAsAsyncCore>d__17`1.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.ModelBinding.FormatterParameterBinding.<ExecuteBindingAsyncCore>d__18.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.HttpActionBinding.<ExecuteBindingAsyncCore>d__12.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\\r\\n---
End of stack trace from previous location where exception was thrown ---\\r\\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\\r\\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()\"\r\n }\r\n ]\r\n }\r\n}"}]}}'
headers:
cache-control:
- no-cache
content-length:
- '2823'
content-type:
- application/json; charset=utf-8
date:
- Tue, 03 Jan 2023 03:46:50 GMT
expires:
- '-1'
pragma:
- no-cache
strict-transport-security:
- max-age=31536000; includeSubDomains
vary:
- Accept-Encoding
x-content-type-options:
- nosniff
status:
code: 200
message: OK
version: 1
Loading

0 comments on commit 1799f82

Please sign in to comment.