@@ -62,7 +62,7 @@ stages:
6262 vmImage : ' macOS-latest'
6363 python.version : ' 3.11'
6464 Windows_py310 :
65- vmImage : ' windows-2019 ' # keep one job pinned to the oldest image
65+ vmImage : ' windows-2022 ' # keep one job pinned to the oldest image
6666 python.version : ' 3.10'
6767 Windows_py311 :
6868 vmImage : ' windows-latest'
@@ -181,50 +181,22 @@ stages:
181181 VS=$(ls -d /c/Program\ Files*/Microsoft\ Visual\ Studio/*/Enterprise)
182182 echo "Visual Studio: ${VS}"
183183 DIR="$VS/Common7/IDE/Extensions/Microsoft/CodeCoverage.Console"
184- if [[ -d $DIR ]]; then
185- # This is for MSVC 2022 (on windows-latest).
186- TOOL="$DIR/Microsoft.CodeCoverage.Console.exe"
187- for f in build/cp*/src/*.pyd; do
188- echo $f
189- echo "=============================="
190- "$TOOL" instrument $f --session-id $SESSION_ID \
191- --log-level Verbose --log-file instrument.log
192- cat instrument.log
193- rm instrument.log
194- done
195- echo "Starting $TOOL in server mode"
196- "$TOOL" collect \
197- --session-id $SESSION_ID --server-mode \
198- --output-format cobertura --output extensions.xml \
199- --log-level Verbose --log-file extensions.log &
200- VS_VER=2022
201- else
202- DIR="$VS"/Team\ Tools/Dynamic\ Code\ Coverage\ Tools/amd64
203- if [[ -d $DIR ]]; then
204- # This is for MSVC 2019 (on windows-2019).
205- VSINSTR="$VS"/Team\ Tools/Performance\ Tools/vsinstr.exe
206- for f in build/cp*/src/*.pyd; do
207- "$VSINSTR" $f -Verbose -Coverage
208- done
209- TOOL="$DIR/CodeCoverage.exe"
210- cat > extensions.config << EOF
211- <CodeCoverage>
212- <CollectFromChildProcesses>true</CollectFromChildProcesses>
213- <ModulePaths>
214- <Include>
215- <ModulePath>.*\\.*\.pyd</ModulePath>
216- </Include>
217- </ModulePaths>
218- </CodeCoverage>
219- EOF
220- echo "Starting $TOOL in server mode"
221- "$TOOL" collect \
222- -config:extensions.config -session:$SESSION_ID \
223- -output:extensions.coverage -verbose &
224- echo "Started $TOOL"
225- VS_VER=2019
226- fi
227- fi
184+ # This is for MSVC 2022 (on windows-latest).
185+ TOOL="$DIR/Microsoft.CodeCoverage.Console.exe"
186+ for f in build/cp*/src/*.pyd; do
187+ echo $f
188+ echo "=============================="
189+ "$TOOL" instrument $f --session-id $SESSION_ID \
190+ --log-level Verbose --log-file instrument.log
191+ cat instrument.log
192+ rm instrument.log
193+ done
194+ echo "Starting $TOOL in server mode"
195+ "$TOOL" collect \
196+ --session-id $SESSION_ID --server-mode \
197+ --output-format cobertura --output extensions.xml \
198+ --log-level Verbose --log-file extensions.log &
199+ VS_VER=2022
228200 echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
229201 fi
230202 PYTHONFAULTHANDLER=1 pytest -rfEsXR -n 2 \
0 commit comments