{testsdk} Move azure-devtools's code to azure-cli-testsdk#20601
{testsdk} Move azure-devtools's code to azure-cli-testsdk#20601
azure-devtools's code to azure-cli-testsdk#20601Conversation
| 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, |
There was a problem hiding this comment.
It don't think it is a good idea to upload the source code py to Storage for testing. @evelyn-ys
| # 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: |
There was a problem hiding this comment.
Changed the code from https://github.com/Azure/azure-python-devtools/blob/1.2.0/src/azure_devtools/scenario_tests/tests/test_utilities.py#L46-L48 to make the test pass on Windows.
See https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile
| result = MockTest().run() | ||
| self.assertTrue(result.skipped) |
There was a problem hiding this comment.
Changed the code from https://github.com/Azure/azure-python-devtools/blob/1.2.0/src/azure_devtools/scenario_tests/tests/test_integration_test_base.py#L67 to make the test pass on latest Python.
See https://docs.python.org/3/library/unittest.html#unittest.TestCase.run
| 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 |
There was a problem hiding this comment.
Added comments for where this module comes from.
azure-devtools's code to azure-cli-testsdkazure-devtools's code to azure-cli-testsdk
Background from Azure SDK team
From @lmazuel:
azure-devtoolsused 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 ofazure_devtools, time making them more and more different.We made a more important refactoring, since we don’t use
vcrpyanymore 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 thatazure-devtoolsis 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_devtoolsis 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_devtoolsdirectly intoazure-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 toazure.cli.testsdk, such as