Skip to content
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
24 changes: 9 additions & 15 deletions src/containerapp-preview/azext_containerapp_preview/_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,15 @@ def poll_results(cmd, request_url):


class ContainerAppClient(_get_azext_containerapp_module("azext_containerapp._clients").ContainerAppClient):
@classmethod
def get_api_version(cls):
return PREVIEW_API_VERSION
api_version = PREVIEW_API_VERSION


class ManagedEnvironmentClient(_get_azext_containerapp_module("azext_containerapp._clients").ManagedEnvironmentClient):
@classmethod
def get_api_version(cls):
return PREVIEW_API_VERSION
api_version = PREVIEW_API_VERSION


class ConnectedEnvironmentClient():
@classmethod
def get_api_version(cls):
return PREVIEW_API_VERSION
api_version = PREVIEW_API_VERSION

@classmethod
def create(cls, cmd, resource_group_name, name, connected_environment_envelope, no_wait=False):
Expand All @@ -56,7 +50,7 @@ def create(cls, cmd, resource_group_name, name, connected_environment_envelope,
sub_id,
resource_group_name,
name,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "PUT", request_url, body=json.dumps(connected_environment_envelope))

Expand All @@ -79,7 +73,7 @@ def update(cls, cmd, resource_group_name, name, managed_environment_envelope, no
sub_id,
resource_group_name,
name,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "PATCH", request_url, body=json.dumps(managed_environment_envelope))

Expand All @@ -105,7 +99,7 @@ def delete(cls, cmd, resource_group_name, name, no_wait=False):
sub_id,
resource_group_name,
name,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "DELETE", request_url)

Expand All @@ -128,7 +122,7 @@ def show(cls, cmd, resource_group_name, name):
sub_id,
resource_group_name,
name,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url)
return r.json()
Expand All @@ -142,7 +136,7 @@ def list_by_subscription(cls, cmd, formatter=lambda x: x):
request_url = "{}/subscriptions/{}/providers/Microsoft.App/connectedEnvironments?api-version={}".format(
management_hostname.strip('/'),
sub_id,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
Expand Down Expand Up @@ -171,7 +165,7 @@ def list_by_resource_group(cls, cmd, resource_group_name, formatter=lambda x: x)
management_hostname.strip('/'),
sub_id,
resource_group_name,
cls.get_api_version())
cls.api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url)
j = r.json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ def setUp(self):
cmd = ['azdev', 'extension', 'add', 'k8s-extension']
run(cmd, check=True)

def tearDown(self):
cmd = ['azdev', 'extension', 'remove', 'containerapp']
Copy link
Contributor Author

@Greedygre Greedygre Jul 12, 2023

Choose a reason for hiding this comment

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

To make concurrent execution of tests more stable.

Copy link
Contributor Author

@Greedygre Greedygre Jul 12, 2023

Choose a reason for hiding this comment

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

@wangzelin007

This CI test failed Pipelines - Run 20230712.36 logs (azure.com)

only python 3.10 tests failed. And Error as following.


[gw0] [ 50%] FAILED src/containerapp-preview/azext_containerapp_preview/tests/latest/test_containerapp_preview_scenario.py::ContainerappScenarioTest::test_containerapp_preview_e2e

src/containerapp-preview/azext_containerapp_preview/tests/latest/test_containerapp_preview_scenario.py::ContainerappScenarioTest::test_containerapp_preview_environment_type

[gw0] [100%] PASSED src/containerapp-preview/azext_containerapp_preview/tests/latest/test_containerapp_preview_scenario.py::ContainerappScenarioTest::test_containerapp_preview_environment_type

 

ERROR cli.azure.cli.core.azclierror:azlogging.py:212 unrecognized arguments: --environment-type managed

ERROR az_command_data_logger:azlogging.py:213 unrecognized arguments: --environment-type managed


Copy link
Contributor Author

Choose a reason for hiding this comment

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

And with more and more test cases( with different file), this kind of azdev extension add containerapp in a case will be unstable

run(cmd, check=True)
cmd = ['azdev', 'extension', 'remove', 'connectedk8s']
run(cmd, check=True)
cmd = ['azdev', 'extension', 'remove', 'k8s-extension']
run(cmd, check=True)

super(ContainerappScenarioTest, self).tearDown()

@ResourceGroupPreparer(location="eastus", random_name_length=15)
def test_containerapp_preview_environment_type(self, resource_group):
self.cmd('configure --defaults location={}'.format(TEST_LOCATION))
Expand Down
Loading