Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{testsdk} Move azure-devtools's code to azure-cli-testsdk #20601

Merged
merged 8 commits into from
Dec 9, 2021

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented Dec 3, 2021

Background from Azure SDK team

From @lmazuel:

azure-devtools used to be a repo shared across SDK and CLI to share the test infra. We forked our own version a few years ago. We did try to re-share it (see Azure/azure-python-devtools#60 to backport SDK changes into that repo). This PR never got merged, and SDK continued to use different version of azure_devtools, time making them more and more different.

We made a more important refactoring, since we don’t use vcrpy anymore to record tests. I think we reached a level where we can now more officially say that we won’t ever merge back again those two projects. Which means to me that azure-devtools is now officially used only by CLI team. SDK team didn’t use this repo for that last 3 years and don’t plan to use it.

Q&A

Q: Is azure_devtools is still used by Python SDKs or other tools?
A: Not used by SDK for 3 years.

Q: Where is the release pipeline for azure_devtools?
A: It’s used to be plugged with TravisCI.

Q: Is it a good practice to vendor/incorporate azure_devtools directly into azure-cli-testsdk?
A: I think you should vendor that code indeed. I would suggest to archive that repo and migrate the code into the CLI tests code.

Reference

Email: Destiny of azure_devtools

Required changes for extensions

If you import from azure_devtools, change it to azure.cli.testsdk, such as

- from azure_devtools.scenario_tests import AllowLargeResponse
+ from azure.cli.testsdk.scenario_tests import AllowLargeResponse

@@ -94,7 +94,7 @@ interactions:
api_version_constraint)\r\nfrom knack.util import CLIError\r\nfrom azure.cli.core.profiles
import ResourceType\r\n\r\nfrom azure.cli.command_modules.storage._client_factory
import MISSING_CREDENTIALS_ERROR_MESSAGE\r\nfrom ..storage_test_util import
StorageScenarioMixin\r\nfrom azure_devtools.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE,
StorageScenarioMixin\r\nfrom azure.cli.testsdk.scenario_tests import AllowLargeResponse\r\n\r\n\r\n@api_version_constraint(ResourceType.MGMT_STORAGE,
Copy link
Member Author

@jiasli jiasli Dec 3, 2021

Choose a reason for hiding this comment

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

It don't think it is a good idea to upload the source code py to Storage for testing. @evelyn-ys

Comment on lines +48 to +51
# https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
# delete=False must be set for Windows, because Windows doesn't allow opening a temporary file
# that is already opened.
with tempfile.NamedTemporaryFile(delete=False) as f:
Copy link
Member Author

@jiasli jiasli Dec 3, 2021

Choose a reason for hiding this comment

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

Comment on lines +66 to +67
result = MockTest().run()
self.assertTrue(result.skipped)
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +7 to +10
This module is vendored from
https://github.com/Azure/azure-python-devtools/tree/1.2.0/src/azure_devtools/scenario_tests

More info: https://github.com/Azure/azure-cli/pull/20601
Copy link
Member Author

@jiasli jiasli Dec 3, 2021

Choose a reason for hiding this comment

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

Added comments for where this module comes from.

@jiasli jiasli requested a review from lmazuel December 9, 2021 06:37
@jiasli jiasli changed the title {TestSDK} Move azure-devtools's code to azure-cli-testsdk {testsdk} Move azure-devtools's code to azure-cli-testsdk Dec 9, 2021
@jiasli jiasli merged commit 30216d0 into Azure:dev Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants