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

Check in Appconfig scenarios and recording assets #21798

Merged
merged 11 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Copy link
Contributor Author

@leni-msft leni-msft Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
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

```