Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
datafactory test scenario (#381)
Browse files Browse the repository at this point in the history
* datafactory test scenario

* test-scenario

* adjust scenario
  • Loading branch information
changlong-liu authored May 25, 2020
1 parent 064dfd4 commit 8083032
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 65 deletions.
38 changes: 38 additions & 0 deletions src/test/scenarios/datafactory/configuration/readme.cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,42 @@ These settings don't need to apply `--cli` on the command line.
``` yaml $(cli)
cli:
cli-name: datafactory
test-scenario:
- name: /Factories/put/Factories_CreateOrUpdate
- name: /Factories/get/Factories_Get
- name: /Factories/get/Factories_List
- name: /Factories/get/Factories_ListByResourceGroup
- name: /Factories/post/Factories_ConfigureFactoryRepo
- name: /Factories/post/Factories_GetDataPlaneAccess
- name: /Factories/post/Factories_GetGitHubAccessToken
- name: /Factories/patch/Factories_Update
- name: /IntegrationRuntimes/put/IntegrationRuntimes_Create
- name: /IntegrationRuntimes/put/IntegrationRuntimes_Create
- name: /IntegrationRuntimes/get/IntegrationRuntimes_Get
- name: /IntegrationRuntimes/get/IntegrationRuntimes_ListByFactory
- name: /IntegrationRuntimes/post/IntegrationRuntimes_CreateLinkedIntegrationRuntime
- name: /IntegrationRuntimes/post/IntegrationRuntimes_GetConnectionInfo
- name: /IntegrationRuntimes/post/IntegrationRuntimes_GetMonitoringData
- name: /IntegrationRuntimes/post/IntegrationRuntimes_GetStatus
- name: /IntegrationRuntimes/post/IntegrationRuntimes_ListAuthKeys
- name: /IntegrationRuntimes/post/IntegrationRuntimes_RegenerateAuthKey
- name: /IntegrationRuntimes/post/IntegrationRuntimes_RemoveLinks
- name: /IntegrationRuntimes/post/IntegrationRuntimes_Start
- name: /IntegrationRuntimes/post/IntegrationRuntimes_Stop
- name: /IntegrationRuntimes/post/IntegrationRuntimes_SyncCredentials
- name: /IntegrationRuntimes/post/IntegrationRuntimes_Upgrade
- name: /IntegrationRuntimes/patch/IntegrationRuntimes_Update
- name: /Triggers/put/Triggers_Create
- name: /Triggers/put/Triggers_Update
- name: /Triggers/get/Triggers_Get
- name: /Triggers/get/Triggers_ListByFactory
- name: /Triggers/post/Triggers_GetEventSubscriptionStatus
- name: /Triggers/post/Triggers_QueryByFactory
- name: /Triggers/post/Triggers_Start
- name: /Triggers/post/Triggers_Stop
- name: /Triggers/post/Triggers_SubscribeToEvents
- name: /Triggers/post/Triggers_UnsubscribeFromEvents
- name: /IntegrationRuntimes/delete/IntegrationRuntimes_Delete
- name: /Triggers/delete/Triggers_Delete
- name: /Factories/delete/Factories_Delete
```
2 changes: 1 addition & 1 deletion src/test/scenarios/datafactory/input/datafactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@
],
"operationId": "IntegrationRuntimes_RemoveLinks",
"x-ms-examples": {
"IntegrationRuntimes_Upgrade": {
"IntegrationRuntimes_RemoveLinks": {
"$ref": "./examples/IntegrationRuntimes_RemoveLinks.json"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
short-summary: Remove all linked integration runtimes under specific data factory in a self-hosted integration runt\
ime.
examples:
- name: IntegrationRuntimes_Upgrade
- name: IntegrationRuntimes_RemoveLinks
text: |-
az datafactory integration-runtime remove-link --factory-name "exampleFactoryName" --name "exampleIntegr\
ationRuntime" --resource-group "exampleResourceGroup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ def step__factories_put_factories_createorupdate(test, rg):
checks=[])


# EXAMPLE: /Factories/get/Factories_Get
@try_manual
def step__factories_get_factories_get(test, rg):
test.cmd('az datafactory show '
'--name "{exampleFactoryName}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /Factories/get/Factories_List
@try_manual
def step__factories_get_factories_list(test, rg):
Expand Down Expand Up @@ -96,11 +105,13 @@ def step__factories_patch_factories_update(test, rg):
checks=[])


# EXAMPLE: /Factories/get/Factories_Get
# EXAMPLE: /IntegrationRuntimes/put/IntegrationRuntimes_Create
@try_manual
def step__factories_get_factories_get(test, rg):
test.cmd('az datafactory show '
'--name "{exampleFactoryName}" '
def step__integrationruntimes_put_integrationruntimes_create(test, rg):
test.cmd('az datafactory integration-runtime managed create '
'--factory-name "{exampleFactoryName}" '
'--description "A selfhosted integration runtime" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
checks=[])

Expand All @@ -116,12 +127,11 @@ def step__integrationruntimes_put_integrationruntimes_create(test, rg):
checks=[])


# EXAMPLE: /IntegrationRuntimes/put/IntegrationRuntimes_Create
# EXAMPLE: /IntegrationRuntimes/get/IntegrationRuntimes_Get
@try_manual
def step__integrationruntimes_put_integrationruntimes_create(test, rg):
test.cmd('az datafactory integration-runtime managed create '
def step__integrationruntimes_get_integrationruntimes_get(test, rg):
test.cmd('az datafactory integration-runtime show '
'--factory-name "{exampleFactoryName}" '
'--description "A selfhosted integration runtime" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
checks=[])
Expand Down Expand Up @@ -202,45 +212,40 @@ def step__integrationruntimes_post_integrationruntimes_regenerateauthkey(test, r
checks=[])


# EXAMPLE: /Triggers/put/Triggers_Create
# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_RemoveLinks
@try_manual
def step__triggers_put_triggers_create(test, rg):
test.cmd('az datafactory trigger create '
def step__integrationruntimes_post_integrationruntimes_removelinks(test, rg):
test.cmd('az datafactory integration-runtime remove-link '
'--factory-name "{exampleFactoryName}" '
'--resource-group "{rg}" '
'--properties "{{\\"type\\":\\"ScheduleTrigger\\",\\"pipelines\\":[{{\\"parameters\\":{{\\"OutputBlobNameL'
'ist\\":[\\"exampleoutput.csv\\"]}},\\"pipelineReference\\":{{\\"type\\":\\"PipelineReference\\",\\"refere'
'nceName\\":\\"examplePipeline\\"}}}}],\\"typeProperties\\":{{\\"recurrence\\":{{\\"endTime\\":\\"2018-06-'
'16T00:55:13.8441801Z\\",\\"frequency\\":\\"Minute\\",\\"interval\\":4,\\"startTime\\":\\"2018-06-16T00:39'
':13.8441801Z\\",\\"timeZone\\":\\"UTC\\"}}}}}}" '
'--name "{exampleTrigger}"',
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Stop
# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Start
@try_manual
def step__integrationruntimes_post_integrationruntimes_stop(test, rg):
test.cmd('az datafactory integration-runtime stop '
def step__integrationruntimes_post_integrationruntimes_start(test, rg):
test.cmd('az datafactory integration-runtime start '
'--factory-name "{exampleFactoryName}" '
'--name "{IntegrationRuntimes_2}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_SyncCredentials
# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Stop
@try_manual
def step__integrationruntimes_post_integrationruntimes_synccredentials(test, rg):
test.cmd('az datafactory integration-runtime sync-credentials '
def step__integrationruntimes_post_integrationruntimes_stop(test, rg):
test.cmd('az datafactory integration-runtime stop '
'--factory-name "{exampleFactoryName}" '
'--name "{exampleIntegrationRuntime}" '
'--name "{IntegrationRuntimes_2}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Upgrade
# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_SyncCredentials
@try_manual
def step__integrationruntimes_post_integrationruntimes_upgrade(test, rg):
test.cmd('az datafactory integration-runtime remove-link '
def step__integrationruntimes_post_integrationruntimes_synccredentials(test, rg):
test.cmd('az datafactory integration-runtime sync-credentials '
'--factory-name "{exampleFactoryName}" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
Expand All @@ -250,7 +255,7 @@ def step__integrationruntimes_post_integrationruntimes_upgrade(test, rg):
# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Upgrade
@try_manual
def step__integrationruntimes_post_integrationruntimes_upgrade(test, rg):
test.cmd('az datafactory integration-runtime remove-link '
test.cmd('az datafactory integration-runtime upgrade '
'--factory-name "{exampleFactoryName}" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
Expand All @@ -269,6 +274,21 @@ def step__integrationruntimes_patch_integrationruntimes_update(test, rg):
checks=[])


# EXAMPLE: /Triggers/put/Triggers_Create
@try_manual
def step__triggers_put_triggers_create(test, rg):
test.cmd('az datafactory trigger create '
'--factory-name "{exampleFactoryName}" '
'--resource-group "{rg}" '
'--properties "{{\\"type\\":\\"ScheduleTrigger\\",\\"pipelines\\":[{{\\"parameters\\":{{\\"OutputBlobNameL'
'ist\\":[\\"exampleoutput.csv\\"]}},\\"pipelineReference\\":{{\\"type\\":\\"PipelineReference\\",\\"refere'
'nceName\\":\\"examplePipeline\\"}}}}],\\"typeProperties\\":{{\\"recurrence\\":{{\\"endTime\\":\\"2018-06-'
'16T00:55:13.8441801Z\\",\\"frequency\\":\\"Minute\\",\\"interval\\":4,\\"startTime\\":\\"2018-06-16T00:39'
':13.8441801Z\\",\\"timeZone\\":\\"UTC\\"}}}}}}" '
'--name "{exampleTrigger}"',
checks=[])


# EXAMPLE: /Triggers/put/Triggers_Update
@try_manual
def step__triggers_put_triggers_update(test, rg):
Expand Down Expand Up @@ -363,43 +383,23 @@ def step__triggers_post_triggers_unsubscribefromevents(test, rg):
checks=[])


# EXAMPLE: /Triggers/delete/Triggers_Delete
@try_manual
def step__triggers_delete_triggers_delete(test, rg):
test.cmd('az datafactory trigger delete '
'--factory-name "{exampleFactoryName}" '
'--resource-group "{rg}" '
'--name "{exampleTrigger}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/get/IntegrationRuntimes_Get
# EXAMPLE: /IntegrationRuntimes/delete/IntegrationRuntimes_Delete
@try_manual
def step__integrationruntimes_get_integrationruntimes_get(test, rg):
test.cmd('az datafactory integration-runtime show '
def step__integrationruntimes_delete_integrationruntimes_delete(test, rg):
test.cmd('az datafactory integration-runtime delete '
'--factory-name "{exampleFactoryName}" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/post/IntegrationRuntimes_Start
@try_manual
def step__integrationruntimes_post_integrationruntimes_start(test, rg):
test.cmd('az datafactory integration-runtime start '
'--factory-name "{exampleFactoryName}" '
'--name "{IntegrationRuntimes_2}" '
'--resource-group "{rg}"',
checks=[])


# EXAMPLE: /IntegrationRuntimes/delete/IntegrationRuntimes_Delete
# EXAMPLE: /Triggers/delete/Triggers_Delete
@try_manual
def step__integrationruntimes_delete_integrationruntimes_delete(test, rg):
test.cmd('az datafactory integration-runtime delete '
def step__triggers_delete_triggers_delete(test, rg):
test.cmd('az datafactory trigger delete '
'--factory-name "{exampleFactoryName}" '
'--name "{exampleIntegrationRuntime}" '
'--resource-group "{rg}"',
'--resource-group "{rg}" '
'--name "{exampleTrigger}"',
checks=[])


Expand All @@ -421,28 +421,30 @@ def cleanup(test, rg):
def call_scenario(test, rg):
setup(test, rg)
step__factories_put_factories_createorupdate(test, rg)
step__factories_get_factories_get(test, rg)
step__factories_get_factories_list(test, rg)
step__factories_get_factories_listbyresourcegroup(test, rg)
step__factories_post_factories_configurefactoryrepo(test, rg)
step__factories_post_factories_getdataplaneaccess(test, rg)
step__factories_post_factories_getgithubaccesstoken(test, rg)
step__factories_patch_factories_update(test, rg)
step__factories_get_factories_get(test, rg)
step__integrationruntimes_put_integrationruntimes_create(test, rg)
step__integrationruntimes_put_integrationruntimes_create(test, rg)
step__integrationruntimes_get_integrationruntimes_get(test, rg)
step__integrationruntimes_get_integrationruntimes_listbyfactory(test, rg)
step__integrationruntimes_post_integrationruntimes_createlinkedintegrationruntime(test, rg)
step__integrationruntimes_post_integrationruntimes_getconnectioninfo(test, rg)
step__integrationruntimes_post_integrationruntimes_getmonitoringdata(test, rg)
step__integrationruntimes_post_integrationruntimes_getstatus(test, rg)
step__integrationruntimes_post_integrationruntimes_listauthkeys(test, rg)
step__integrationruntimes_post_integrationruntimes_regenerateauthkey(test, rg)
step__triggers_put_triggers_create(test, rg)
step__integrationruntimes_post_integrationruntimes_removelinks(test, rg)
step__integrationruntimes_post_integrationruntimes_start(test, rg)
step__integrationruntimes_post_integrationruntimes_stop(test, rg)
step__integrationruntimes_post_integrationruntimes_synccredentials(test, rg)
step__integrationruntimes_post_integrationruntimes_upgrade(test, rg)
step__integrationruntimes_post_integrationruntimes_upgrade(test, rg)
step__integrationruntimes_patch_integrationruntimes_update(test, rg)
step__triggers_put_triggers_create(test, rg)
step__triggers_put_triggers_update(test, rg)
step__triggers_get_triggers_get(test, rg)
step__triggers_get_triggers_listbyfactory(test, rg)
Expand All @@ -452,10 +454,8 @@ def call_scenario(test, rg):
step__triggers_post_triggers_stop(test, rg)
step__triggers_post_triggers_subscribetoevents(test, rg)
step__triggers_post_triggers_unsubscribefromevents(test, rg)
step__triggers_delete_triggers_delete(test, rg)
step__integrationruntimes_get_integrationruntimes_get(test, rg)
step__integrationruntimes_post_integrationruntimes_start(test, rg)
step__integrationruntimes_delete_integrationruntimes_delete(test, rg)
step__triggers_delete_triggers_delete(test, rg)
step__factories_delete_factories_delete(test, rg)
cleanup(test, rg)

Expand Down

0 comments on commit 8083032

Please sign in to comment.