-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Windows installer tests in their own container #101
Draft
zooba
wants to merge
11
commits into
master
Choose a base branch
from
test-in-docker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5871cde
Run installer tests in their own container
zooba a9dae6c
This is PowerShell, not Python
zooba 1c7bcc1
Ensure tmp directory exists
zooba fb7d895
Needs plusses
zooba 69b0c53
iex instead of &
zooba 698c941
Check exit code after iex
zooba 7c7380c
Correct name helps
zooba 2ce2d54
Mount MSI directory properly
zooba 8e53eb4
Work around broken Powershell 5.0+
zooba 8bea5f9
Use correct logs directory
zooba c7f5125
Try with server image
zooba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
param ([string]$SetupExe) | ||
|
||
Write-Host "##[section]Install Python" | ||
$SetupCmd = "$SetupExe " + ` | ||
"/passive /log ""C:\Logs\install\log.txt"" " + ` | ||
"TargetDir=C:\Python " + ` | ||
"Include_debug=1 " + ` | ||
"Include_symbols=1 " + ` | ||
"InstallAllUsers=${env:InstallAllUsers} " + ` | ||
"${env:IncludeFreethreadedOpt}" | ||
Write-Host "##[command]$SetupCmd" | ||
iex $SetupCmd | ||
if ($LASTEXITCODE) { exit $LASTEXITCODE } | ||
|
||
Write-Host "##[command]dir C:\Python" | ||
dir C:\Python | ||
|
||
$env:PATH = "C:\Python:${env:PATH}" | ||
|
||
|
||
Write-Host "##[section]Capture Start Menu items" | ||
Write-Host "##[command]dir -r ""${env:PROGRAMDATA}\Microsoft\Windows\Start Menu\Programs\Python*""" | ||
dir -r "${env:PROGRAMDATA}\Microsoft\Windows\Start Menu\Programs\Python*" | ||
|
||
Write-Host "##[command]dir -r ""${env:APPDATA}\Microsoft\Windows\Start Menu\Programs\Python*""" | ||
dir -r "${env:APPDATA}\Microsoft\Windows\Start Menu\Programs\Python*" | ||
|
||
Write-Host "##[section]Capture registry" | ||
Write-Host 'Capture per-machine 32-bit registry' | ||
# PS 5.0 and later can't do this, because they normalise registry paths incorrectly | ||
# So we'll use the good old "reg" tool | ||
#Write-Host "##[command]dir -r ""HKLM:\Software\WOW6432Node\Python""" | ||
#dir -r "HKLM:\Software\WOW6432Node\Python" | ||
Write-Host "##[command]reg HKLM\Software\Python /s /reg:32" | ||
reg HKLM\Software\Python /s /reg:32 | ||
|
||
Write-Host 'Capture per-machine native registry' | ||
#Write-Host "##[command]dir -r ""HKLM:\Software\Python""" | ||
#dir -r "HKLM:\Software\Python" | ||
Write-Host "##[command]reg HKLM\Software\Python /s /reg:64" | ||
reg HKLM\Software\Python /s /reg:64 | ||
|
||
Write-Host 'Capture current-user registry' | ||
#Write-Host "##[command]dir -r ""HKCU:\Software\Python""" | ||
#dir -r "HKCU:\Software\Python" | ||
Write-Host "##[command]reg HKCU\Software\Python /s" | ||
reg HKCU\Software\Python /s | ||
|
||
|
||
if (-not $env:SkipTests) { | ||
Write-Host "##[section]Smoke tests" | ||
Write-Host "##[command]python -c ""import sys; print(sys.version)""" | ||
python -c "import sys; print(sys.version)" | ||
if (!$?) { exit $LASTEXITCODE } | ||
Write-Host "##[command]python -m site" | ||
python -m site | ||
if (!$?) { exit $LASTEXITCODE } | ||
|
||
if ($env:IncludeFreethreadedOpt) { | ||
$p = (gci "C:\Python\python3*t.exe" | select -First 1) | ||
if (-not $p) { | ||
Write-Host "Did not find python3*t.exe in:" | ||
dir "C:\Python" | ||
throw "Free-threaded binaries were not installed" | ||
} | ||
Write-Host "Found free threaded executable $p" | ||
Write-Host "##[command]$p -c ""import sys; print(sys.version)""" | ||
& $p -c "import sys; print(sys.version)" | ||
if (!$?) { exit $LASTEXITCODE } | ||
} | ||
|
||
Write-Host "##[section]Test (un)install package" | ||
Write-Host "##[command]python -m pip install ""azure<0.10""" | ||
python -m pip install "azure<0.10" | ||
if (!$?) { exit $LASTEXITCODE } | ||
Write-Host "##[command]python -m pip uninstall -y azure python-dateutil six" | ||
python -m pip uninstall -y azure python-dateutil six | ||
if (!$?) { exit $LASTEXITCODE } | ||
|
||
if (-not $env:SkipTkTests) { | ||
Write-Host "##[section]Test Tkinter and Idle" | ||
if (Test-Path -Type Container "C:\Python\Lib\test\test_ttk") { | ||
# New set of tests (3.12 and later) | ||
Write-Host "##[command]python -m test -uall -v test_ttk test_tkinter test_idle" | ||
python -m test -uall -v test_ttk test_tkinter test_idle | ||
if (!$?) { exit $LASTEXITCODE } | ||
} else { | ||
# Old set of tests | ||
Write-Host "##[command]python -m test -uall -v test_ttk_guionly test_tk test_idle" | ||
python -m test -uall -v test_ttk_guionly test_tk test_idle | ||
if (!$?) { exit $LASTEXITCODE } | ||
} | ||
} | ||
} | ||
|
||
Write-Host "##[section]Uninstall Python" | ||
$UninstallCmd = "$(SetupExe) /passive /uninstall /log C:\Logs\uninstall\log.txt" | ||
Write-Host "##[command]$UninstallCmd" | ||
iex $UninstallCmd | ||
if ($LASTEXITCODE) { exit $LASTEXITCODE } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the containers don't seem to have
reg.exe
, so these steps probably need to be replaced with our own custom code for listing the registry.Or maybe we can downgrade Powershell to a version that isn't broken by PowerShell/PowerShell#5536