-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[TestProxy] Run test with testproxy for mgmt SDK
Yuchao Yan edited this page Feb 20, 2023
·
12 revisions
-
Python 3.7 or later is required
-
create virtual environment
python -m venv venv .\venv-dev\Scripts\Activate.ps1
-
prepare SDK repo if needed
git clone https://github.com/Azure/azure-sdk-for-python.git
-
prepare test proxy environment
-
Setting environment variables (Powershell)
run following command
$env:AZURE_TENANT_ID="xxxxxxxxxxxxxxxx" $env:AZURE_CLIENT_ID="xxxxxxxxxxxxxxxx" $env:AZURE_CLIENT_SECRET="xxxxxxxxxxxxxxxx" $env:AZURE_SUBSCRIPTION_ID="xxxxxxxxxxxxxxxx"
-
Setting the necessary configuration
-
Copy mgmt_settings_real_.py to
tools\azure-sdk-tools\devtools_testutils
and rename it tomgmt_settings_real.py
-
Replace the
ENV_SUBSCRIPTION_ID
,ENV_CLIENT_ID
,ENV_CLIENT_SECRET
,ENV_TENANT_ID
with available values in this file. (Note: some values appear multiple times and need to be replaced completely)
-
-
Preparation dependence
Go to the directory for test. Like this:
D:\azure-sdk-for-python\sdk\servicebus\azure-mgmt-servicebus
And run command:
pip install -r dev_requirements.txt pip install -e .
-
Then run test command like:
(venv) D:\azure-sdk-for-python\sdk\servicebus\azure-mgmt-servicebus>pytest tests
-
Check the test results
-
Complete migration guide