Skip to content

Commit e2d02f1

Browse files
authored
TestBase: Add new API Packages_RunTest (#4725)
* Add new action API * Add example * Fix style error
1 parent 83164b4 commit e2d02f1

File tree

6 files changed

+142
-0
lines changed

6 files changed

+142
-0
lines changed

specification/testbase/resource-manager/Microsoft.TestBase/stable/2021-09-01/examples/PackageCreate.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
{
125125
"testType": "OutOfBoxTest",
126126
"validationRunStatus": "Passed",
127+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
127128
"isActive": true,
128129
"commands": [
129130
{
@@ -225,6 +226,7 @@
225226
{
226227
"testType": "OutOfBoxTest",
227228
"validationRunStatus": "Passed",
229+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
228230
"isActive": true,
229231
"commands": [
230232
{

specification/testbase/resource-manager/Microsoft.TestBase/stable/2021-09-01/examples/PackageGet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
{
5050
"testType": "OutOfBoxTest",
5151
"validationRunStatus": "Passed",
52+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
5253
"isActive": true,
5354
"commands": [
5455
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "476f61a4-952c-422a-b4db-568a828f35df",
4+
"resourceGroupName": "contoso-rg1",
5+
"testBaseAccountName": "contoso-testBaseAccount1",
6+
"packageName": "contoso-package2",
7+
"api-version": "2021-09-01",
8+
"parameters": {
9+
"testType": "OutOfBoxTest",
10+
"osUpdateType": "SecurityUpdate",
11+
"osName": "Windows 10 21H1",
12+
"releaseName": "2021.05 B"
13+
}
14+
},
15+
"responses": {
16+
"200": {},
17+
"202": {
18+
"headers": {
19+
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/operationResults/dGVjaGVkX01hbmFnZVJvbGVfNWRiNGI3Ng==?api-version=2021-09-01",
20+
"Location": "https://management.azure.com/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/operationResults/dGVjaGVkX01hbmFnZVJvbGVfNWRiNGI3Ng==?api-version=2021-09-01"
21+
}
22+
},
23+
"204": {}
24+
}
25+
}

specification/testbase/resource-manager/Microsoft.TestBase/stable/2021-09-01/examples/PackageUpdate.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
{
123123
"testType": "OutOfBoxTest",
124124
"validationRunStatus": "Passed",
125+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
125126
"isActive": true,
126127
"commands": [
127128
{

specification/testbase/resource-manager/Microsoft.TestBase/stable/2021-09-01/examples/PackagesList.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
{
6060
"testType": "OutOfBoxTest",
6161
"validationRunStatus": "Passed",
62+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package1/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
6263
"isActive": true,
6364
"commands": [
6465
{
@@ -114,6 +115,7 @@
114115
{
115116
"testType": "FunctionalTest",
116117
"validationRunStatus": "Passed",
118+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package1/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
117119
"isActive": true,
118120
"commands": [
119121
{
@@ -186,6 +188,7 @@
186188
{
187189
"testType": "OutOfBoxTest",
188190
"validationRunStatus": "Passed",
191+
"validationResultId": "/subscriptions/476f61a4-952c-422a-b4db-568a828f35df/resourceGroups/contoso-rg1/providers/Microsoft.TestBase/testBaseAccounts/contoso-testBaseAccount1/packages/contoso-package2/testResults/TestResult-51d71a5f-e012-4192-88f7-bd12e0bac2b0",
189192
"isActive": true,
190193
"commands": [
191194
{

specification/testbase/resource-manager/Microsoft.TestBase/stable/2021-09-01/testbase.json

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,72 @@
13091309
}
13101310
}
13111311
},
1312+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/packages/{packageName}/runTest": {
1313+
"post": {
1314+
"tags": [
1315+
"Test Base Package"
1316+
],
1317+
"operationId": "Packages_RunTest",
1318+
"description": "Trigger a test run on the package.",
1319+
"parameters": [
1320+
{
1321+
"name": "parameters",
1322+
"in": "body",
1323+
"schema": {
1324+
"$ref": "#/definitions/PackageRunTestParameters"
1325+
},
1326+
"description": "The parameters supplied to the Test Base Package to start a Test Run."
1327+
},
1328+
{
1329+
"$ref": "#/parameters/SubscriptionIdParameter"
1330+
},
1331+
{
1332+
"$ref": "#/parameters/ResourceGroupParameter"
1333+
},
1334+
{
1335+
"$ref": "#/parameters/TestBaseAccountNameParameter"
1336+
},
1337+
{
1338+
"$ref": "#/parameters/PackageNameParameter"
1339+
},
1340+
{
1341+
"$ref": "#/parameters/ApiVersionParameter"
1342+
}
1343+
],
1344+
"responses": {
1345+
"200": {
1346+
"description": "The test is triggered successfully."
1347+
},
1348+
"202": {
1349+
"description": "The request to trigger a test was accepted. Follow the Location header to poll for final outcome.",
1350+
"headers": {
1351+
"Azure-AsyncOperation": {
1352+
"description": "URL to query for status of the operation.",
1353+
"type": "string"
1354+
},
1355+
"Location": {
1356+
"description": "URL to query for status of the operation.",
1357+
"type": "string"
1358+
}
1359+
}
1360+
},
1361+
"204": {
1362+
"description": "The test is triggered successfully."
1363+
},
1364+
"default": {
1365+
"description": "Error response describing why the operation failed.",
1366+
"schema": {
1367+
"$ref": "#/definitions/ErrorResponse"
1368+
}
1369+
}
1370+
},
1371+
"x-ms-examples": {
1372+
"PackageRunTest": {
1373+
"$ref": "./examples/PackageRunTest.json"
1374+
}
1375+
}
1376+
}
1377+
},
13121378
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/testSummaries": {
13131379
"get": {
13141380
"tags": [
@@ -3036,6 +3102,45 @@
30363102
"type": "object",
30373103
"description": "Description of a Check Name availability response properties."
30383104
},
3105+
"PackageRunTestParameters": {
3106+
"description": "The parameters supplied to the Test Base Package to start a Test Run.",
3107+
"type": "object",
3108+
"properties": {
3109+
"testType": {
3110+
"$ref": "#/definitions/TestType",
3111+
"description": "The type of the test."
3112+
},
3113+
"osUpdateType": {
3114+
"type": "string",
3115+
"description": "Specifies the OS update type to test against.",
3116+
"default": "SecurityUpdate",
3117+
"enum": [
3118+
"SecurityUpdate",
3119+
"FeatureUpdate"
3120+
],
3121+
"x-ms-enum": {
3122+
"name": "osUpdateType",
3123+
"modelAsString": true
3124+
}
3125+
},
3126+
"osName": {
3127+
"type": "string",
3128+
"description": "The operating system name. e.g. Windows 10 1809."
3129+
},
3130+
"releaseName": {
3131+
"type": "string",
3132+
"description": "The name of the tested release (OS update)."
3133+
},
3134+
"flightingRing": {
3135+
"type": "string",
3136+
"description": "The flighting ring, only for release of feature updates."
3137+
}
3138+
},
3139+
"required": [
3140+
"testType",
3141+
"osName"
3142+
]
3143+
},
30393144
"PackageListResult": {
30403145
"description": "A list of Test Base Packages.",
30413146
"type": "object",
@@ -3249,6 +3354,11 @@
32493354
"modelAsString": true
32503355
}
32513356
},
3357+
"validationResultId": {
3358+
"readOnly": true,
3359+
"type": "string",
3360+
"description": "Resource identifier of the validation test result."
3361+
},
32523362
"isActive": {
32533363
"type": "boolean",
32543364
"description": "Indicates if this test is active.It doesn't schedule test for not active Test."

0 commit comments

Comments
 (0)