forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Confluent] Add new test flow and fix bugs (Azure#3587)
- Loading branch information
Showing
7 changed files
with
2,072 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.17.0" | ||
"azext.minCliCoreVersion": "2.25.0" | ||
} |
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
1,991 changes: 1,991 additions & 0 deletions
1,991
src/confluent/azext_confluent/tests/latest/recordings/test_term_accept_basic_flow.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
src/confluent/azext_confluent/tests/latest/test_confluent_scenario_coverage.md
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt| | ||
|step_terms_list|successed||||2021-07-01 10:18:02.406899|2021-07-01 10:18:02.587908| | ||
|step_organization_show|successed||||2021-07-01 10:18:02.902892|2021-07-01 10:18:02.999867| | ||
|step_organization_list|successed||||2021-07-01 10:18:02.999867|2021-07-01 10:18:03.094902| | ||
|step_organization_list2|successed||||2021-07-01 10:18:03.094902|2021-07-01 10:18:03.190902| | ||
|step_organization_update|successed||||2021-07-01 10:18:03.190902|2021-07-01 10:18:03.287868| | ||
|step_organization_delete|successed||||2021-07-01 10:18:03.287868|2021-07-01 10:18:03.506873| | ||
|step_terms_list|successed||||2021-07-07 05:49:18.241849|2021-07-07 05:49:18.473003| | ||
|step_organization_show|successed||||2021-07-07 05:49:18.846170|2021-07-07 05:49:18.948916| | ||
|step_organization_list|successed||||2021-07-07 05:49:18.948916|2021-07-07 05:49:19.053372| | ||
|step_organization_list2|successed||||2021-07-07 05:49:19.054372|2021-07-07 05:49:19.153368| | ||
|step_organization_update|successed||||2021-07-07 05:49:19.154380|2021-07-07 05:49:19.254379| | ||
|step_organization_delete|successed||||2021-07-07 05:49:19.254379|2021-07-07 05:49:19.477328| | ||
Coverage: 6/6 |
62 changes: 62 additions & 0 deletions
62
src/confluent/azext_confluent/tests/latest/test_confluent_term_accept_flow.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,62 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
import mock | ||
import time | ||
|
||
from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer | ||
from azure_devtools.scenario_tests import AllowLargeResponse | ||
|
||
from .test_confluent_scenario import mock_jwt_decode, mock_list_role_assignments | ||
|
||
|
||
class TestTermAcceptFlow(ScenarioTest): | ||
|
||
@ResourceGroupPreparer(name_prefix='cli_test_term_accept_basic_flow', location='eastus2euap') | ||
@AllowLargeResponse() | ||
def test_term_accept_basic_flow(self, resource_group): | ||
|
||
self.kwargs.update({ | ||
'rg': resource_group, | ||
'offerId': 'confluent-cloud-azure-stag', | ||
'planId': 'confluent-cloud-azure-payg-stag', | ||
'publisherId': 'confluentinc', | ||
'namespace': 'Microsoft.Confluent', | ||
'organizationName': 'cliTestOrg-1' | ||
}) | ||
|
||
self.cmd('az confluent offer-detail show ' | ||
'--publisher-id {publisherId} ' | ||
'--offer-id {offerId}') | ||
|
||
self.cmd('az term accept ' | ||
'--product "{offerId}" ' | ||
'--plan "{planId}" ' | ||
'--publisher "{publisherId}"') | ||
|
||
self.cmd('provider register -n {namespace} ') | ||
result = self.cmd('provider show -n {namespace}').get_output_in_json() | ||
while result['registrationState'] != 'Registered': | ||
time.sleep(5) | ||
result = self.cmd('provider show -n {namespace}').get_output_in_json() | ||
|
||
with mock.patch('jwt.decode', mock_jwt_decode): | ||
with mock.patch('azure.cli.command_modules.role.custom.list_role_assignments', mock_list_role_assignments): | ||
self.cmd('az confluent organization create ' | ||
'--location "eastus2euap" ' | ||
'--offer-id "{offerId}" ' | ||
'--plan-id "{planId}" ' | ||
'--plan-name "Confluent Cloud - Pay as you Go" ' | ||
'--publisher-id "{publisherId}" ' | ||
'--term-unit "P1M" ' | ||
'--tags environment="Dev" ' | ||
'--name "{organizationName}" ' | ||
'--resource-group "{rg}"') | ||
|
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