Skip to content

[TestProxy] Run test with testproxy for mgmt SDK

Jiefeng Chen edited this page Feb 24, 2022 · 13 revisions

Getting Started - Run test with testproxy for mgmt SDK

Prerequisites

  • Python 3.7 or later is required

  • Docker

  • create virtual environment

    python -m venv venv-dev
    .\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"
    

How to Run Test

  • 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 in venv\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 MicrosoftTeams-image (4)

Clone this wiki locally