2019-05-22 22:24:21 +00:00
|
|
|
# Azure Pipelines CI job template for PyDM Tests
|
|
|
|
# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/anaconda?view=azure-devops
|
|
|
|
parameters:
|
|
|
|
name: ''
|
|
|
|
vmImage: ''
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: ${{ parameters.name }}
|
|
|
|
pool:
|
|
|
|
vmImage: ${{ parameters.vmImage }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-06-09 04:55:32 +00:00
|
|
|
Python27-PyQt4-4.8:
|
2019-05-22 22:24:21 +00:00
|
|
|
python.version: '2.7'
|
|
|
|
qt.bindings: "pyqt=4"
|
2019-05-29 05:42:01 +00:00
|
|
|
install.method: "conda"
|
2019-06-09 04:55:32 +00:00
|
|
|
Python27-PySide-4.8:
|
2019-05-22 22:24:21 +00:00
|
|
|
python.version: '2.7'
|
|
|
|
qt.bindings: "pyside"
|
|
|
|
install.method: "conda"
|
2020-06-04 04:27:49 +00:00
|
|
|
Python36-PyQt5-5.9:
|
2019-06-09 01:42:37 +00:00
|
|
|
python.version: "3.6"
|
2019-05-22 22:24:21 +00:00
|
|
|
qt.bindings: "pyqt"
|
|
|
|
install.method: "conda"
|
2020-02-21 17:28:48 +00:00
|
|
|
Python37-PySide2-5.13:
|
|
|
|
python.version: "3.7"
|
2019-05-22 22:24:21 +00:00
|
|
|
qt.bindings: "pyside2"
|
|
|
|
install.method: "conda"
|
2020-06-04 04:27:49 +00:00
|
|
|
Python38-PyQt5-Latest:
|
2020-02-21 17:28:48 +00:00
|
|
|
python.version: '3.8'
|
2019-05-22 22:24:21 +00:00
|
|
|
qt.bindings: "PyQt5"
|
|
|
|
install.method: "pip"
|
2020-06-04 04:27:49 +00:00
|
|
|
Python38-PySide2-Latest:
|
|
|
|
python.version: '3.8'
|
|
|
|
qt.bindings: "PySide2"
|
|
|
|
install.method: "pip"
|
2019-05-22 22:24:21 +00:00
|
|
|
|
|
|
|
steps:
|
2019-08-29 20:56:25 +00:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
source: 'current'
|
|
|
|
artifact: wheel
|
|
|
|
path: 'dist'
|
|
|
|
|
2019-05-29 05:42:01 +00:00
|
|
|
- task: ScreenResolutionUtility@1
|
|
|
|
inputs:
|
|
|
|
displaySettings: 'specific'
|
|
|
|
width: '1920'
|
|
|
|
height: '1080'
|
|
|
|
condition: eq(variables['agent.os'], 'Windows_NT' )
|
|
|
|
|
2019-08-29 20:56:25 +00:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: $(python.version)
|
|
|
|
condition: eq(variables['install.method'], 'pip')
|
|
|
|
|
2019-06-24 06:03:51 +00:00
|
|
|
- script: |
|
|
|
|
curl -LJO https://github.com/pal1000/mesa-dist-win/releases/download/19.1.0/mesa3d-19.1.0-release-msvc.exe
|
|
|
|
7z x mesa3d-19.1.0-release-msvc.exe
|
|
|
|
cd x64
|
|
|
|
xcopy opengl32.dll C:\windows\system32\mesadrv.dll*
|
|
|
|
xcopy opengl32.dll C:\windows\syswow64\mesadrv.dll*
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v DLL /t REG_SZ /d "mesadrv.dll" /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v DriverVersion /t REG_DWORD /d 1 /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v Flags /t REG_DWORD /d 1 /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v Version /t REG_DWORD /d 2 /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v DLL /t REG_SZ /d "mesadrv.dll" /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v DriverVersion /t REG_DWORD /d 1 /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v Flags /t REG_DWORD /d 1 /f
|
|
|
|
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL" /v Version /t REG_DWORD /d 2 /f
|
|
|
|
displayName: "Install Windows-Mesa OpenGL DLL"
|
|
|
|
condition: eq(variables['agent.os'], 'Windows_NT')
|
|
|
|
|
2019-05-22 22:24:21 +00:00
|
|
|
- bash: |
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(agent.os) == 'Linux' ]
|
|
|
|
then
|
2019-08-29 20:56:25 +00:00
|
|
|
echo "##vso[task.prependpath]$CONDA/bin"
|
2019-05-29 05:42:01 +00:00
|
|
|
elif [ $(agent.os) == 'Darwin' ]
|
|
|
|
then
|
2019-08-29 20:56:25 +00:00
|
|
|
sudo chown -R $USER $CONDA
|
|
|
|
echo "##vso[task.prependpath]$CONDA/bin"
|
2019-05-29 05:42:01 +00:00
|
|
|
elif [ $(agent.os) == 'Windows_NT' ]
|
|
|
|
then
|
2019-08-29 20:56:25 +00:00
|
|
|
echo "##vso[task.prependpath]$CONDA/Scripts"
|
2019-05-29 05:42:01 +00:00
|
|
|
else
|
|
|
|
echo 'Just what OS are you using?'
|
|
|
|
fi
|
2019-08-29 20:56:25 +00:00
|
|
|
displayName: 'Add Conda To $PATH'
|
2019-05-29 05:42:01 +00:00
|
|
|
condition: eq(variables['install.method'], 'conda' )
|
2020-02-22 00:24:33 +00:00
|
|
|
continueOnError: false
|
2019-05-22 22:24:21 +00:00
|
|
|
|
|
|
|
- bash: |
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(install.method) == "conda" ]
|
|
|
|
then
|
2020-02-22 00:24:33 +00:00
|
|
|
conda update --all --yes --quiet
|
2020-02-21 17:28:48 +00:00
|
|
|
conda config --env --set always_yes true
|
2020-02-22 00:24:33 +00:00
|
|
|
if [ $(python.version) == '2.7' ]
|
2020-02-21 17:28:48 +00:00
|
|
|
then
|
|
|
|
conda config --set restore_free_channel true
|
|
|
|
fi
|
|
|
|
if [ $(qt.bindings) == "pyside2" ] || ([ $(qt.bindings) == 'pyside' ] && [ $(agent.os) == 'Darwin' ])
|
|
|
|
then
|
|
|
|
conda config --prepend channels conda-forge
|
|
|
|
fi
|
2020-10-22 03:48:19 +00:00
|
|
|
conda create --name test-environment-$(python.version) python=$(python.version) --yes --quiet
|
|
|
|
source activate test-environment-$(python.version)
|
2020-02-21 17:28:48 +00:00
|
|
|
conda info
|
|
|
|
conda install $(qt.bindings) numpy scipy pyopengl h5py six --yes --quiet
|
2020-06-28 15:51:34 +00:00
|
|
|
pip install matplotlib
|
2019-05-29 05:42:01 +00:00
|
|
|
else
|
2020-06-28 15:51:34 +00:00
|
|
|
pip install $(qt.bindings) numpy scipy pyopengl h5py six matplotlib
|
2019-05-29 05:42:01 +00:00
|
|
|
fi
|
2020-02-22 00:24:33 +00:00
|
|
|
pip install pytest pytest-cov coverage pytest-xdist
|
2019-06-30 20:30:58 +00:00
|
|
|
if [ $(python.version) == "2.7" ]
|
|
|
|
then
|
2019-08-29 20:56:25 +00:00
|
|
|
pip install pytest-faulthandler==1.6.0
|
2019-07-01 18:25:29 +00:00
|
|
|
export PYTEST_ADDOPTS="--faulthandler-timeout=15"
|
2020-02-22 00:24:33 +00:00
|
|
|
else
|
|
|
|
pip install pytest pytest-cov coverage
|
2019-06-30 20:30:58 +00:00
|
|
|
fi
|
2019-05-29 05:42:01 +00:00
|
|
|
displayName: "Install Dependencies"
|
2019-08-29 20:56:25 +00:00
|
|
|
|
2019-05-22 22:24:21 +00:00
|
|
|
- bash: |
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(install.method) == "conda" ]
|
|
|
|
then
|
|
|
|
source activate test-environment-$(python.version)
|
|
|
|
fi
|
2019-08-29 20:56:25 +00:00
|
|
|
python -m pip install --no-index --find-links=dist pyqtgraph
|
|
|
|
displayName: 'Install Wheel'
|
2019-05-22 22:24:21 +00:00
|
|
|
|
|
|
|
- bash: |
|
2020-06-01 07:09:16 +00:00
|
|
|
sudo apt-get install -y libxkbcommon-x11-dev
|
|
|
|
# workaround for QTBUG-84489
|
|
|
|
sudo apt-get install -y libxcb-xfixes0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(install.method) == "conda" ]
|
|
|
|
then
|
|
|
|
source activate test-environment-$(python.version)
|
|
|
|
fi
|
2020-06-10 03:26:21 +00:00
|
|
|
if [ $(python.version) == "2.7" ]
|
|
|
|
then
|
|
|
|
pip install PyVirtualDisplay==0.2.5 pytest-xvfb==1.2.0
|
|
|
|
else
|
|
|
|
pip install pytest-xvfb
|
|
|
|
fi
|
2019-06-24 06:03:51 +00:00
|
|
|
displayName: "Virtual Display Setup"
|
2019-05-29 05:42:01 +00:00
|
|
|
condition: eq(variables['agent.os'], 'Linux' )
|
2019-06-24 06:03:51 +00:00
|
|
|
|
2019-05-22 22:24:21 +00:00
|
|
|
- bash: |
|
2020-06-01 07:09:16 +00:00
|
|
|
export QT_DEBUG_PLUGINS=1
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(install.method) == "conda" ]
|
|
|
|
then
|
|
|
|
source activate test-environment-$(python.version)
|
|
|
|
fi
|
|
|
|
echo python location: `which python`
|
2019-05-22 22:24:21 +00:00
|
|
|
echo python version: `python --version`
|
2019-05-29 05:42:01 +00:00
|
|
|
echo pytest location: `which pytest`
|
2019-05-22 22:24:21 +00:00
|
|
|
echo installed packages
|
2019-05-29 05:42:01 +00:00
|
|
|
pip list
|
2019-05-22 22:24:21 +00:00
|
|
|
echo pyqtgraph system info
|
|
|
|
python -c "import pyqtgraph as pg; pg.systemInfo()"
|
2019-06-09 04:55:32 +00:00
|
|
|
echo display information
|
|
|
|
if [ $(agent.os) == 'Linux' ]
|
|
|
|
then
|
|
|
|
export DISPLAY=:99.0
|
2019-06-24 06:03:51 +00:00
|
|
|
Xvfb :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset &
|
2019-06-09 04:55:32 +00:00
|
|
|
sleep 3
|
|
|
|
fi
|
|
|
|
python -m pyqtgraph.util.get_resolution
|
2019-06-24 06:03:51 +00:00
|
|
|
echo openGL information
|
|
|
|
python -c "from pyqtgraph.opengl.glInfo import GLTest"
|
2019-05-29 05:42:01 +00:00
|
|
|
displayName: 'Debug Info'
|
2019-05-22 22:24:21 +00:00
|
|
|
continueOnError: false
|
|
|
|
|
2019-06-09 04:55:32 +00:00
|
|
|
- bash: |
|
2019-05-29 05:42:01 +00:00
|
|
|
if [ $(install.method) == "conda" ]
|
|
|
|
then
|
|
|
|
source activate test-environment-$(python.version)
|
|
|
|
fi
|
|
|
|
mkdir -p "$SCREENSHOT_DIR"
|
|
|
|
# echo "If Screenshots are generated, they may be downloaded from:"
|
|
|
|
# echo "https://dev.azure.com/pyqtgraph/pyqtgraph/_apis/build/builds/$(Build.BuildId)/artifacts?artifactName=Screenshots&api-version=5.0"
|
2020-02-21 17:28:48 +00:00
|
|
|
pytest . -v \
|
2020-02-22 00:24:33 +00:00
|
|
|
-n 1 \
|
2019-05-29 05:42:01 +00:00
|
|
|
--junitxml=junit/test-results.xml \
|
2020-02-21 17:28:48 +00:00
|
|
|
--cov pyqtgraph --cov-report=xml --cov-report=html
|
2019-05-29 05:42:01 +00:00
|
|
|
displayName: 'Unit tests'
|
2019-05-22 22:24:21 +00:00
|
|
|
env:
|
2019-05-29 05:42:01 +00:00
|
|
|
AZURE: 1
|
|
|
|
SCREENSHOT_DIR: $(Build.ArtifactStagingDirectory)/screenshots
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish Screenshots'
|
|
|
|
condition: failed()
|
|
|
|
inputs:
|
|
|
|
pathtoPublish: $(Build.ArtifactStagingDirectory)/screenshots
|
|
|
|
artifactName: Screenshots
|
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '**/test-*.xml'
|
|
|
|
testRunTitle: 'Test Results for $(agent.os) - $(python.version) - $(qt.bindings) - $(install.method)'
|
|
|
|
publishRunAttachments: true
|
|
|
|
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: Cobertura
|
|
|
|
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
|
2019-06-30 19:05:57 +00:00
|
|
|
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
|