@@ -33,12 +33,19 @@ jobs:
3333
3434 steps :
3535 - powershell : |
36- powershell .ci/install_opengl.ps1
36+ Set-StrictMode -Version Latest
37+ $ErrorActionPreference = "Stop"
38+ $PSDefaultParameterValues['*:ErrorAction']='Stop'
39+ git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
40+ powershell gl-ci-helpers/appveyor/install_opengl.ps1
41+ displayName: 'Install OpenGL'
42+
43+ - powershell : |
3744 .ci/setup_headless_display.sh
3845 pip install -r .ci/requirements_test_xvfb.txt
3946 python .ci/display_test.py
40- displayName: Install and start a virtual framebuffer
41-
47+ displayName: Install test offscreen rendering
48+
4249 - task : UsePythonVersion@0
4350 inputs :
4451 versionSpec : $(python.version)
5259 - script : |
5360 pip install -r requirements_build.txt
5461 python setup.py bdist_wheel
55- pip install --find-links=dist ansys_dpf_core
62+ FOR /F %%a in ('dir /s/b dist\*.whl') do SET WHEELNAME=%%a
63+ ECHO %WHEELNAME%
64+ pip install %WHEELNAME%
5665 cd tests
5766 python -c "from ansys.dpf import core; print(core.Report(gpu=False))"
5867 displayName: Install ansys-dpf-core
@@ -63,46 +72,59 @@ jobs:
6372 downloadDirectory : ' $(System.DefaultWorkingDirectory)'
6473 feedsToUse : ' internal'
6574 vstsFeed : ' 705e121a-9631-49f5-8aaf-c7142856f923'
66- vstsFeedPackage : ' f913c1d3-1fe4-404c-8c28-15a234e56803 ' # TODO: update hash of packages
67- vstsPackageVersion : ' 21.2.0 '
75+ vstsFeedPackage : ' dpf-windows ' # TODO: update hash of packages
76+ vstsPackageVersion : ' 21.2.3 '
6877
6978 - script : |
7079 @echo on
71- dir $(System.DefaultWorkingDirectory)
80+ dir $(System.DefaultWorkingDirectory)\server\v212\aisol\bin\winx64
7281 set THISDIR=$(System.DefaultWorkingDirectory)
7382 cd %THISDIR%\server\v212\aisol\bin\winx64
7483 START /B Ans.Dpf.Grpc.bat --address 127.0.0.1 --port %DPF_PORT% > log.txt 2>&1
75- python -c "from ansys.dpf import core; core.connect_to_server(port=$(DPF_PORT)); print('Python Connected')"
84+ python -c "from ansys.dpf import core; core.connect_to_server(port=$(DPF_PORT)); print('Python Connected')"
7685 displayName: Start DPF Server
7786
7887 - script : |
7988 pip install -r requirements_test.txt
80- cd tests
81- pytest -v --junitxml=junit/test-results.xml --cov ansys.dpf.core --cov-report=xml
89+ set THISDIR=$(System.DefaultWorkingDirectory)
90+ cd tests=$(System.DefaultWorkingDirectory)
91+ set AWP_ROOT212=%THISDIR%\server\v212
92+ pytest -v --junitxml=junit/test-results.xml --cov ansys.dpf.core --cov-report=xml --reruns 3
93+
8294 displayName: Test Core API
95+
96+ - task : PublishTestResults@2
97+ inputs :
98+ testResultsFormat : ' JUnit'
99+ testResultsFiles : ' junit/test-results.xml'
100+ testRunTitle : ' windowsTests'
101+ publishRunAttachments : true
102+ condition : always()
83103
84104 - script : |
85105 type $(System.DefaultWorkingDirectory)\server\v212\aisol\bin\winx64\log.txt
86106 displayName: 'Show DPF Server Logs'
87107 condition: always()
108+
109+ - script : |
110+ tasklist /FI "IMAGENAME eq Ans.Dpf.Grpc.exe" 2>NUL | find /I /N "Ans.Dpf.Grpc.exe">NUL
111+ ECHO %ERRORLEVEL%
112+ if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe)
113+ displayName: 'Kill all servers'
114+ condition: always()
115+ continueOnError: true
116+
88117
89118 - job : Linux
90119 variables :
91120 python.version : ' 3.7' # due to VTK 8.1.2 requirement for docbuild
92121 DISPLAY : ' :99.0'
93122 PYANSYS_OFF_SCREEN : True
94- DPF_PORT : 32772
95- DPF_START_SERVER : False
96- DPF_IMAGE : docker.pkg.github.com/pyansys/dpf-core/dpf:
97- DPF_DOCKER : True
123+ DPF_PORT : 50055
124+ TEMP : $(System.DefaultWorkingDirectory)/temp
125+
98126 pool :
99127 vmImage : ' ubuntu-20.04'
100- strategy :
101- matrix :
102- DPF2021R1 :
103- DPF.VERSION : ' v2021.1'
104- DPF2021R2 :
105- DPF.VERSION : ' v2021.2'
106128 steps :
107129 - task : UsePythonVersion@0
108130 inputs :
@@ -123,26 +145,69 @@ jobs:
123145 - script : |
124146 pip install -r requirements_build.txt
125147 python setup.py bdist_wheel
126- pip install --find-links=dist ansys_dpf_core
148+ export WHEELNAME=`ls dist/*.whl`
149+ echo ${WHEELNAME}
150+ pip install ${WHEELNAME}
127151 cd tests
128152 python -c "from ansys.dpf import core; print(core.Report())"
129153 displayName: Install ansys-dpf-core
130154
155+ - task : UniversalPackages@0
156+ inputs :
157+ command : ' download'
158+ downloadDirectory : ' $(System.DefaultWorkingDirectory)'
159+ feedsToUse : ' internal'
160+ vstsFeed : ' 705e121a-9631-49f5-8aaf-c7142856f923'
161+ vstsFeedPackage : ' dpf-linux' # TODO: update hash of packages
162+ vstsPackageVersion : ' 21.2.5'
163+
164+ - script : |
165+ echo $0
166+ if pgrep -x "Ans.Dpf.Grpc" > /dev/null
167+ then
168+ pkill -f Ans.Dpf.Grpc.exe
169+ fi
170+ displayName: 'Kill all servers'
171+ condition: always()
172+ continueOnError: true
173+
131174 - script : |
132- set -ex
133- echo $(PAT) | docker login -u $(GH_USERNAME) --password-stdin docker.pkg.github.com
134- docker pull $(DPF_IMAGE)
135- docker run --restart always --name dpf -v `pwd`:/dpf -v /tmp:/dpf/_cache -p $(DPF_PORT):50054 $(DPF_IMAGE) > log.txt &
136- grep -q 'server started on ip' <(timeout 60 tail -f log.txt)
137- python -c "from ansys.dpf import core as dpf; dpf.connect_to_server(port=$(DPF_PORT)); print('Python Connected')"
138- displayName: Pull, launch, and validate DPF service
139-
175+ env
176+ displayName: Display env
177+
178+ - script : |
179+ echo $0
180+ export THISDIR=${SYSTEM_DEFAULTWORKINGDIRECTORY}
181+ echo ${THISDIR}
182+ export AWP_ROOT212=${THISDIR}/server/v212
183+ cd ${THISDIR}/server/v212/aisol/bin/linx64
184+ pwd
185+ chmod 755 Ans.Dpf.Grpc.sh
186+ chmod 755 Ans.Dpf.Grpc.exe
187+ ./Ans.Dpf.Grpc.sh --port 50054 & > log.txt
188+ export DPF_IP=$(hostname -i)
189+ python -c "from ansys.dpf import core; core.connect_to_server(ip= '${DPF_IP}', port=50054); print('Python Connected')"
190+ displayName: Start DPF Server
191+
140192 - script : |
141193 pip install -r requirements_test.txt
142- pip install pytest-azurepipelines
194+ pip install pytest-azurepipelines
195+ export AWP_ROOT212=${SYSTEM_DEFAULTWORKINGDIRECTORY}/server/v212
143196 cd tests
144- pytest -v --junitxml=junit/test-results.xml --cov ansys.dpf.core --cov-report=xml --cov-report=html
197+ export DPF_IP=$(hostname -i)
198+ pytest -v --junitxml=junit/test-results.xml --cov ansys.dpf.core --cov-report=xml --reruns 3
199+ export PATH=`pwd`
200+ echo ${PATH}
145201 displayName: Test Core API
202+
203+ - task : PublishTestResults@2
204+ inputs :
205+ testResultsFormat : ' JUnit'
206+ testResultsFiles : ' junit/test-results.xml'
207+ testRunTitle : ' linuxTests'
208+ publishRunAttachments : true
209+ searchFolder : ' tests/'
210+ condition : always()
146211
147212 - script : |
148213 pip install twine
@@ -154,3 +219,15 @@ jobs:
154219 TWINE_USERNAME: __token__
155220 TWINE_PASSWORD: $(PYPI_TOKEN)
156221 TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
222+
223+ - script : |
224+ echo $0
225+ if pgrep -x "Ans.Dpf.Grpc" > /dev/null
226+ then
227+ pkill -f Ans.Dpf.Grpc.exe
228+ fi
229+ displayName: 'Kill all servers'
230+ condition: always()
231+ continueOnError: true
232+
233+
0 commit comments