Skip to content

Commit

Permalink
Check in Appconfig scenarios and recording assets (#21798)
Browse files Browse the repository at this point in the history
* add appconfig control-plane scenarios

* touch swagger

* push tag successfully

* check in tag

* move assets.json to scenarios folder

* update tag

* add appconfig data-plane scenarios

* push data-plane apitest recording

* update mgmt recording

* restore swagger

* update recording
  • Loading branch information
leni-msft authored Jan 4, 2023
1 parent 1ccb9d2 commit d166d2b
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ warnings.txt

# API Test outputs
.apitest
.assets

*.js
*.d.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "",
"TagPrefix": "apitest/appconfiguration/dataplane",
"Tag": "apitest/appconfiguration/dataplane_7a9e215e2e"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json
scope: ./liveness.yaml

authentication:
type: AADToken
scope: https://azconfig.io/.default

variables:
key:
type: string
prefix: key

scenarios:
- steps:
- step: PutKeyValue
exampleFile: ../examples/PutKeyValue.json
- step: PutLock
exampleFile: ../examples/PutLock.json
- step: GetKeys
exampleFile: ../examples/GetKeys.json
- step: CheckKeys
exampleFile: ../examples/CheckKeys.json
- step: GetKeyValues
exampleFile: ../examples/GetKeyValues.json
- step: CheckKeyValues
exampleFile: ../examples/CheckKeyValues.json
- step: DeleteKeyValue
exampleFile: ../examples/DeleteKeyValue.json
- step: GetKeyValue
exampleFile: ../examples/GetKeyValue.json
- step: CheckKeyValue
exampleFile: ../examples/CheckKeyValue.json
- step: GetLabels
exampleFile: ../examples/GetLabels.json
- step: CheckLabels
exampleFile: ../examples/CheckLabels.json
- step: DeleteLock
exampleFile: ../examples/DeleteLock.json
- step: GetRevisions
exampleFile: ../examples/GetRevisions.json
- step: CheckRevisions
exampleFile: ../examples/CheckRevisions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json

scope: ResourceGroup
variables:
configStoreName:
type: string
prefix: configstor

prepareSteps:
- step: Operations_CheckNameAvailability
operationId: Operations_CheckNameAvailability
readmeTag: ../../../../../resource-manager/readme.md
parameters:
checkNameAvailabilityParameters:
name: $(configStoreName)
type: Microsoft.AppConfiguration/configurationStores
- step: ConfigurationStores_Create
operationId: ConfigurationStores_Create
readmeTag: ../../../../../resource-manager/readme.md
parameters:
configStoreCreationParameters:
location: $(location)
sku:
name: Standard
tags:
myTag: myTagValue
- step: ConfigurationStores_Get
operationId: ConfigurationStores_Get
readmeTag: ../../../../../resource-manager/readme.md
outputVariables:
endpoint:
type: string
fromResponse: /properties/endpoint
configStoreId:
type: string
fromResponse: /id
- step: assignRole
roleAssignment:
scope: $(configStoreId)
principalId: $(object_id)
principalType: ServicePrincipal
roleName: App Configuration Data Owner

scenarios:
- scenario: liveness
authentication:
type: AADToken
scope: https://azconfig.io/.default
steps:
- operationId: CheckKeys
8 changes: 8 additions & 0 deletions specification/appconfiguration/data-plane/readme.test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Tag: package-1-0

These settings apply only when `--tag=package-1-0` is specified on the command line.

``` yaml $(tag) == 'package-1-0'
test-resources:
- Microsoft.AppConfiguration/stable/1.0/scenarios/basic.yaml
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "",
"TagPrefix": "apitest/appconfiguration/management",
"Tag": "apitest/appconfiguration/management_164ac7ad8e"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/documentation/api-scenario/references/v1.2/schema.json
scope: ResourceGroup
variables:
configStoreName:
type: string
prefix: configstor
privateEndpointConnectionName:
type: string
prefix: privateend
keyValueName:
type: string
prefix: keyvaluena
groupName: configurationStores

prepareSteps:
- step: createVirtualNetwork
operationId: VirtualNetworks_CreateOrUpdate
readmeTag: ../../../../../../network/resource-manager/readme.md
parameters:
virtualNetworkName: $(configStoreName)-vnet
parameters:
location: $(location)
properties:
addressSpace:
addressPrefixes:
- 10.0.0.0/16
subnets:
- name: subnet-1
properties:
addressPrefix: 10.0.0.0/24
outputVariables:
subnetId:
type: string
fromResponse: /properties/subnets/0/id

- step: createPublicIPAddress
operationId: PublicIPAddresses_CreateOrUpdate
readmeTag: ../../../../../../network/resource-manager/readme.md
parameters:
publicIpAddressName: $(configStoreName)-ip
parameters:
location: $(location)

scenarios:
- steps:
- step: Operations_List
operationId: Operations_List
- step: Operations_CheckNameAvailability
exampleFile: ../examples/CheckNameAvailable.json
- step: Operations_RegionalCheckNameAvailability
exampleFile: ../examples/RegionalCheckNameAvailable.json
- step: ConfigurationStores_Create
exampleFile: ../examples/ConfigurationStoresCreate.json
outputVariables:
configurationStoreId:
type: string
fromResponse: /id
- step: ConfigurationStores_List
exampleFile: ../examples/ConfigurationStoresList.json
- step: ConfigurationStores_ListByResourceGroup
exampleFile: ../examples/ConfigurationStoresListByResourceGroup.json
- step: ConfigurationStores_ListDeleted
exampleFile: ../examples/DeletedConfigurationStoresList.json
- step: ConfigurationStores_Get
exampleFile: ../examples/ConfigurationStoresGet.json
- step: ConfigurationStores_Update
exampleFile: ../examples/ConfigurationStoresUpdate.json
- step: ConfigurationStores_ListKeys
exampleFile: ../examples/ConfigurationStoresListKeys.json
outputVariables:
keyId:
fromResponse: /value/0/id
- step: ConfigurationStores_RegenerateKey
exampleFile: ../examples/ConfigurationStoresRegenerateKey.json
requestUpdate:
- replace: /regenerateKeyParameters/id
value: $(keyId)
- step: KeyValues_CreateOrUpdate
exampleFile: ../examples/ConfigurationStoresCreateKeyValue.json
- step: KeyValues_Get
exampleFile: ../examples/ConfigurationStoresGetKeyValue.json
- step: createPrivateEndpoints
operationId: PrivateEndpoints_CreateOrUpdate
readmeTag: ../../../../../../network/resource-manager/readme.md
parameters:
privateEndpointName: $(privateEndpointConnectionName)-endpoint
parameters:
location: $(location)
properties:
subnet:
id: $(subnetId)
privateLinkServiceConnections:
- name: $(privateEndpointConnectionName)
properties:
privateLinkServiceId: $(configurationStoreId)
groupIds:
- $(groupName)
- step: PrivateEndpointConnections_Update
exampleFile: ../examples/ConfigurationStoresCreatePrivateEndpointConnection.json
- step: PrivateEndpointConnections_ListByConfigurationStore
exampleFile: ../examples/ConfigurationStoresListPrivateEndpointConnections.json
- step: PrivateEndpointConnections_Get
exampleFile: ../examples/ConfigurationStoresGetPrivateEndpointConnection.json
- step: PrivateLinkResources_ListByConfigurationStore
exampleFile: ../examples/PrivateLinkResourcesListByConfigurationStore.json
- step: PrivateLinkResources_Get
exampleFile: ../examples/PrivateLinkResourceGet.json
- step: PrivateEndpointConnections_Delete
exampleFile: ../examples/ConfigurationStoresDeletePrivateEndpointConnection.json
- step: KeyValues_Delete
exampleFile: ../examples/ConfigurationStoresDeleteKeyValue.json
- step: ConfigurationStores_Delete
exampleFile: ../examples/ConfigurationStoresDelete.json
- step: ConfigurationStores_GetDeleted
exampleFile: ../examples/DeletedConfigurationStoresGet.json
- step: ConfigurationStores_PurgeDeleted
exampleFile: ../examples/DeletedConfigurationStoresPurge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Tag: package-2022-05-01

These settings apply only when `--tag=package-2022-05-01` is specified on the command line.

``` yaml $(tag) == 'package-2022-05-01'
test-resources:
- Microsoft.AppConfiguration/stable/2022-05-01/scenarios/basic.yaml

```

0 comments on commit d166d2b

Please sign in to comment.