1jobs: 2- job: Test_MSI 3 displayName: Test MSI 4 5 pool: 6 vmImage: windows-2019 7 8 workspace: 9 clean: all 10 11 strategy: 12 matrix: 13 win32_User: 14 ExeMatch: 'python-[\dabrc.]+-webinstall\.exe' 15 Logs: $(Build.ArtifactStagingDirectory)\logs\win32_User 16 InstallAllUsers: 0 17 win32_Machine: 18 ExeMatch: 'python-[\dabrc.]+-webinstall\.exe' 19 Logs: $(Build.ArtifactStagingDirectory)\logs\win32_Machine 20 InstallAllUsers: 1 21 amd64_User: 22 ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe' 23 Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_User 24 InstallAllUsers: 0 25 amd64_Machine: 26 ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe' 27 Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_Machine 28 InstallAllUsers: 1 29 30 steps: 31 - checkout: none 32 33 - task: DownloadPipelineArtifact@1 34 displayName: 'Download artifact: msi' 35 inputs: 36 artifactName: msi 37 targetPath: $(Build.BinariesDirectory)\msi 38 39 - powershell: | 40 $p = (gci -r *.exe | ?{ $_.Name -match '$(ExeMatch)' } | select -First 1) 41 Write-Host "##vso[task.setvariable variable=SetupExe]$($p.FullName)" 42 Write-Host "##vso[task.setvariable variable=SetupExeName]$($p.Name)" 43 displayName: 'Find installer executable' 44 workingDirectory: $(Build.BinariesDirectory)\msi 45 46 - script: > 47 "$(SetupExe)" 48 /passive 49 /log "$(Logs)\install\log.txt" 50 TargetDir="$(Build.BinariesDirectory)\Python" 51 Include_debug=1 52 Include_symbols=1 53 InstallAllUsers=$(InstallAllUsers) 54 displayName: 'Install Python' 55 56 - powershell: | 57 $p = gi "$(Build.BinariesDirectory)\Python\python.exe" 58 Write-Host "##vso[task.prependpath]$(Split-Path -Parent $p)" 59 displayName: 'Add test Python to PATH' 60 61 - script: | 62 python -c "import sys; print(sys.version)" 63 displayName: 'Collect version number' 64 65 - script: | 66 python -m site 67 displayName: 'Collect site' 68 69 - powershell: | 70 gci -r "${env:PROGRAMDATA}\Microsoft\Windows\Start Menu\Programs\Python*" 71 displayName: 'Capture per-machine Start Menu items' 72 - powershell: | 73 gci -r "${env:APPDATA}\Microsoft\Windows\Start Menu\Programs\Python*" 74 displayName: 'Capture per-user Start Menu items' 75 76 - powershell: | 77 gci -r "HKLM:\Software\WOW6432Node\Python" 78 displayName: 'Capture per-machine 32-bit registry' 79 - powershell: | 80 gci -r "HKLM:\Software\Python" 81 displayName: 'Capture per-machine native registry' 82 - powershell: | 83 gci -r "HKCU:\Software\Python" 84 displayName: 'Capture current-user registry' 85 86 - script: | 87 python -m pip install "azure<0.10" 88 python -m pip uninstall -y azure python-dateutil six 89 displayName: 'Test (un)install package' 90 91 - script: | 92 python -m test -uall -v test_ttk_guionly test_tk test_idle 93 displayName: 'Test Tkinter and Idle' 94 95 - script: > 96 "$(SetupExe)" 97 /passive 98 /uninstall 99 /log "$(Logs)\uninstall\log.txt" 100 displayName: 'Uninstall Python' 101 102 - task: PublishBuildArtifacts@1 103 displayName: 'Publish Artifact: logs' 104 condition: true 105 continueOnError: true 106 inputs: 107 PathtoPublish: '$(Build.ArtifactStagingDirectory)\logs' 108 ArtifactName: msi_testlogs 109