-
Notifications
You must be signed in to change notification settings - Fork 3k
[TestProxy] Run test with testproxy for mgmt SDK
-
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 TestProxy if needed. (more details)
Run the following command to download and run the docker image with Testproxy.
.\eng\common\testproxy\docker-start-proxy.ps1 "start"
-
Setting environment variables
run following command
set AZURE_TENANT_ID="xxxxxxxxxxxxxxxx" set AZURE_CLIENT_ID="xxxxxxxxxxxxxxxx" set AZURE_CLIENT_SECRET="xxxxxxxxxxxxxxxx" set AZURE_SUBSCRIPTION_ID="xxxxxxxxxxxxxxxx"
-
Setting the necessary configuration
-
Copy mgmt_settings_real_.py
tools\azure-sdk-tools\devtools_testutils
and name itmgmt_settings_real.py
-
Change the
SUBSCRIPTION_ID
,CLIENT_ID
,CLIENT_SECRET
,TENANT_ID
variables on lines 13 to 18 of this file.
-
-
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 .
-
Add test proxy certificate
Copy certificate to
cacert.pem
invenv\Lib\site-packages\certifi\
-
Then run test command. Like this:
(venv) D:\azure-sdk-for-python\sdk\servicebus\azure-mgmt-servicebus>pytest tests
-
Check the test results
-
Complete migration guide