Skip to content

Conversation

@snehapar9
Copy link
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd
Copy link

Hi @snehapar9,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@ghost ghost requested a review from yonzhan June 15, 2023 16:32
@ghost ghost added the Auto-Assign Auto assign by bot label Jun 15, 2023
@ghost ghost requested a review from wangzelin007 June 15, 2023 16:32
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 15, 2023

Thank you for your contribution! We will review the pull request and get back to you soon.

@ghost ghost requested a review from yanzhudd June 15, 2023 16:32
@ghost ghost assigned zhoxing-ms Jun 15, 2023
@ghost ghost added the ContainerApp label Jun 15, 2023
@ghost ghost requested review from jsntcy and zhoxing-ms June 15, 2023 16:32
Copy link
Member

@harryli0108 harryli0108 left a comment

Choose a reason for hiding this comment

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

I think all looks good from my side. Meanwhile, commented a couple of questions.

self.assertTrue(resp.ok)

# Re-run the 'az containerapp up' command with the location parameter if provided
if location:
Copy link
Member

Choose a reason for hiding this comment

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

I know this part is similar to the up command test case., but could you clarify the reason why we need to rerun the command with location argument instead of directly providing this as an argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@harryli0108 just made some changes to re-use this method for containerapp up and patch commands.

app = self.cmd(f"containerapp show -g {resource_group} -n {app_name}").get_output_in_json()
image = app["properties"]["template"]["containers"][0]["image"]
self.assertEquals(image,"mcr.microsoft.com/k8se/quickstart:latest")

Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we could deploy 2 container apps (one with quick start image, one with an old patchable image) to make sure that the --show-all is working properly by adding assert to check how many results have been returned by the patcher list command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@harryli0108 In my opinion, it may be better to explicitly check for the image name than the count of container apps returned from patch list. The ordering may not be the same every time if we have multiple apps and would make it difficult to assert against the image name. I would think it may be okay to keep it simple with just a single container app. Thoughts?

Copy link
Member

@cormacpayne cormacpayne left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise LGTM :shipit:

repo = app["properties"]["template"]["containers"][0]["name"]

# Re-tag image to an older version to simulate patch list
old_tag = "run-dotnet-aspnet-7.0.1-cbl-mariner2.0"
Copy link
Member

Choose a reason for hiding this comment

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

Let's make old_tag an argument of this function to allow tests to be flexible with the older version they want to use

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -0,0 +1,156 @@
#!/usr/bin/env python
Copy link
Member

Choose a reason for hiding this comment

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

nit: do we need this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, we do not. Removed this line

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))

class ContainerAppPatchTest(ScenarioTest):
@live_only()
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask why do you need to mark these new tests as @live_only()?

Copy link
Contributor Author

@snehapar9 snehapar9 Jun 16, 2023

Choose a reason for hiding this comment

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

@zhoxing-ms, these tests are marked @live_only() because they require docker to be running. Since CI does not have docker installed they would not work if they aren't run live.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, thanks~

@zhoxing-ms zhoxing-ms merged commit 3d8a261 into Azure:main Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants