Integration testing utility, which is run from an Azure pipeline upon spinning up a cloud instance of an ESRI Portal.
To incorporate into an Azure DevOps pipeline:
- Click the Azure pipelines link in DevOps
- Select the 'feature/Integration-Testing' branch. Ensure you are in master
- If creating a new job, then 'Add an agent job'
- Set Display name to Integration testing
- Click the + to 'add Task'
- Add 3 command line 'cmd' scripts
- The first command line creates the virtual environment.
Display name = rem create Venv
Script =
echo Creating Python virtual environment in root
cd ..
python -m venv env
- The second installs the python dependencies
Display name = install python dependencies
Script =
echo Setting proxy
set HTTP_PROXY=REMOVED
set HTTPS_PROXY=REMOVED
echo Installing arcgis
cmd /k "cd /d $(System.DefaultWorkingDirectory)\env\Scripts && activate.bat && cd /d $(System.DefaultWorkingDirectory) && python -m pip install --no-cache-dir arcgis"
- The third runs pytest
Display name = run pytests
Script =
set HTTP_PROXY=REMOVED
set HTTPS_PROXY=REMOVED
echo Running Python Tests
cmd /k "cd /d $(System.DefaultWorkingDirectory)\env\Scripts # enters the venv dir
&& activate.bat # activates the venv
&& cd /d $(System.DefaultWorkingDirectory)\tests_py\ # enters the test dir
&& pytest --verbose --junitxml=$(System.DefaultWorkingDirectory)\py-test-results.xml # runs pytest as a command with output in junitxml
- Finally, in addition to the cmd tasks, a Publish Test Results task is added.