-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,692 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
204 changes: 204 additions & 0 deletions
204
src/spring/azext_spring/tests/latest/jobs/recordings/test_asa_job_deploy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- spring job create | ||
Connection: | ||
- keep-alive | ||
ParameterSetName: | ||
- -n -g -s | ||
User-Agent: | ||
- AZURECLI/2.61.0 azsdk-python-core/1.30.1 Python/3.11.9 (Windows-10-10.0.22631-SP0) | ||
method: GET | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002?api-version=2024-05-01-preview | ||
response: | ||
body: | ||
string: '{"properties":{"provisioningState":"Succeeded","zoneRedundant":false,"version":3,"serviceId":"f9520f7dba364c6f98a81e06d3306e4d","networkProfile":{"outboundIPs":{"publicIPs":["172.166.86.56","52.151.108.183"]},"outboundType":"loadBalancer"},"powerState":"Running","fqdn":"clitest000002.azuremicroservices.io","marketplaceResource":{"plan":"asa-ent-hr-mtr","publisher":"vmware-inc","product":"azure-spring-cloud-vmware-tanzu-2"}},"type":"Microsoft.AppPlatform/Spring","sku":{"name":"E0","tier":"Enterprise"},"location":"uksouth","tags":null,"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002","name":"clitest000002","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2024-06-18T08:55:21.6646486Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2024-06-18T08:55:21.6646486Z"}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '948' | ||
content-type: | ||
- application/json | ||
date: | ||
- Tue, 18 Jun 2024 09:02:35 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
request-context: | ||
- appId=cid-v1:797d7e4e-8180-497e-a254-780fbd39ba4d | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-resource-requests: | ||
- '11998' | ||
x-msedge-ref: | ||
- 'Ref A: BF07FCC9F8FB486CA00CDF073D3F8B3F Ref B: MAA201060515011 Ref C: 2024-06-18T09:02:35Z' | ||
x-rp-server-mvid: | ||
- 16f8ed7c-99fe-42f5-98dc-7ba9e82d32d1 | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- spring job create | ||
Connection: | ||
- keep-alive | ||
ParameterSetName: | ||
- -n -g -s | ||
User-Agent: | ||
- AZURECLI/2.61.0 azsdk-python-core/1.30.1 Python/3.11.9 (Windows-10-10.0.22631-SP0) | ||
method: GET | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname?api-version=2024-05-01-preview | ||
response: | ||
body: | ||
string: '{"error":{"code":"NotFound","message":"Job not found.","target":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname","details":null}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '232' | ||
content-type: | ||
- application/json | ||
date: | ||
- Tue, 18 Jun 2024 09:02:37 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
request-context: | ||
- appId=cid-v1:797d7e4e-8180-497e-a254-780fbd39ba4d | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-msedge-ref: | ||
- 'Ref A: CEF0EDE6D4894719AB3A48B6A4529BB1 Ref B: MAA201060513029 Ref C: 2024-06-18T09:02:37Z' | ||
x-rp-server-mvid: | ||
- 16f8ed7c-99fe-42f5-98dc-7ba9e82d32d1 | ||
status: | ||
code: 404 | ||
message: Not Found | ||
- request: | ||
body: '{"properties": {"template": {"environmentVariables": [], "resourceRequests": | ||
{"cpu": "1", "memory": "2Gi"}}, "managedComponentReferences": [], "triggerConfig": | ||
{"triggerType": "Manual"}}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- spring job create | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '187' | ||
Content-Type: | ||
- application/json | ||
ParameterSetName: | ||
- -n -g -s | ||
User-Agent: | ||
- AZURECLI/2.61.0 azsdk-python-core/1.30.1 Python/3.11.9 (Windows-10-10.0.22631-SP0) | ||
method: PUT | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname?api-version=2024-05-01-preview | ||
response: | ||
body: | ||
string: '{"properties":{"provisioningState":"Succeeded","triggerConfig":{"triggerType":"Manual"},"template":{"environmentVariables":[],"resourceRequests":{"cpu":"1","memory":"2Gi"}},"managedComponentReferences":[]},"type":"Microsoft.AppPlatform/Spring/jobs","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname","name":"jobname","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2024-06-18T09:02:39.5631944Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2024-06-18T09:02:39.5631944Z"}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '665' | ||
content-type: | ||
- application/json | ||
date: | ||
- Tue, 18 Jun 2024 09:02:40 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
request-context: | ||
- appId=cid-v1:797d7e4e-8180-497e-a254-780fbd39ba4d | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-ms-ratelimit-remaining-subscription-writes: | ||
- '1199' | ||
x-msedge-ref: | ||
- 'Ref A: 9B6C740EEC294DF4B10B81BECA99FE1D Ref B: MAA201060514019 Ref C: 2024-06-18T09:02:39Z' | ||
x-rp-server-mvid: | ||
- 16f8ed7c-99fe-42f5-98dc-7ba9e82d32d1 | ||
status: | ||
code: 200 | ||
message: OK | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
CommandName: | ||
- spring job create | ||
Connection: | ||
- keep-alive | ||
ParameterSetName: | ||
- -n -g -s | ||
User-Agent: | ||
- AZURECLI/2.61.0 azsdk-python-core/1.30.1 Python/3.11.9 (Windows-10-10.0.22631-SP0) | ||
method: GET | ||
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname?api-version=2024-05-01-preview | ||
response: | ||
body: | ||
string: '{"properties":{"provisioningState":"Succeeded","triggerConfig":{"triggerType":"Manual"},"template":{"environmentVariables":[],"resourceRequests":{"cpu":"1","memory":"2Gi"}},"managedComponentReferences":[]},"type":"Microsoft.AppPlatform/Spring/jobs","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.AppPlatform/Spring/clitest000002/jobs/jobname","name":"jobname","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2024-06-18T09:02:39.5631944Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2024-06-18T09:02:39.5631944Z"}}' | ||
headers: | ||
cache-control: | ||
- no-cache | ||
content-length: | ||
- '665' | ||
content-type: | ||
- application/json | ||
date: | ||
- Tue, 18 Jun 2024 09:02:42 GMT | ||
expires: | ||
- '-1' | ||
pragma: | ||
- no-cache | ||
request-context: | ||
- appId=cid-v1:797d7e4e-8180-497e-a254-780fbd39ba4d | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains | ||
x-cache: | ||
- CONFIG_NOCACHE | ||
x-content-type-options: | ||
- nosniff | ||
x-msedge-ref: | ||
- 'Ref A: F42A0765A49A45938FEA4EF66AF3FE52 Ref B: MAA201060514023 Ref C: 2024-06-18T09:02:41Z' | ||
x-rp-server-mvid: | ||
- 16f8ed7c-99fe-42f5-98dc-7ba9e82d32d1 | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
34 changes: 34 additions & 0 deletions
34
src/spring/azext_spring/tests/latest/jobs/test_asa_job_deploy_scenario.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
import os | ||
|
||
from knack.util import CLIError | ||
from azure.cli.testsdk import (ScenarioTest, record_only) | ||
from ..custom_preparers import (SpringPreparer, SpringResourceGroupPreparer) | ||
from ..custom_dev_setting_constant import SpringTestEnvironmentEnum | ||
|
||
|
||
class JobDeploy(ScenarioTest): | ||
|
||
@SpringResourceGroupPreparer(dev_setting_name=SpringTestEnvironmentEnum.ENTERPRISE['resource_group_name']) | ||
@SpringPreparer(**SpringTestEnvironmentEnum.ENTERPRISE['spring']) | ||
def test_asa_job_deploy(self, resource_group, spring): | ||
py_path = os.path.abspath(os.path.dirname(__file__)) | ||
file_path = os.path.join(py_path, 'files/test1.jar').replace("\\", "/") | ||
self.kwargs.update({ | ||
'job': 'jobname', | ||
'serviceName': spring, | ||
'rg': resource_group, | ||
'file': file_path | ||
}) | ||
|
||
self.cmd('spring job create -n {job} -g {rg} -s {serviceName}', checks=[ | ||
self.check('name', '{job}') | ||
]) | ||
|
||
# deploy unexist file, the fail is expected | ||
with self.assertRaisesRegexp(CLIError, "artifact path does not exist."): | ||
self.cmd('spring job deploy -n {job} -g {rg} -s {serviceName} --artifact-path {file}') |
Oops, something went wrong.