Updates to Docker package tests#7667
Conversation
|
|
||
| $responce = Invoke-RestMethod -Method Get -Uri $($ContainerUrl + $SAS + 'restype=container&comp=list') | ||
|
|
||
| $xmlResponce = [xml]$responce.Remove(0,3) # remove some bad chars in the beginning that break XML parsing |
There was a problem hiding this comment.
This is fragile. It needs to remove chars based on where it finds beginning of XML code rather than removing hardcoded number of chars. Will update shortly.
| RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME | ||
| RUN yum install -y $PACKAGENAME | ||
| RUN $TESTDOWNLOADCOMMAND | ||
| RUN pwsh$PREVIEWSUFFIX -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" |
There was a problem hiding this comment.
Add a $null = before New-Item
| RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME | ||
| RUN yum install -y $PACKAGENAME | ||
| RUN $TESTDOWNLOADCOMMAND | ||
| RUN pwsh$PREVIEWSUFFIX -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount" |
There was a problem hiding this comment.
Maybe Start-PSPester might be better instead of Invoke-Pester as it loads helpers. It uses -Path parameter for the test list.
There was a problem hiding this comment.
After we discussed this, I could not make it work. We'll need to dig deeper later; for this PR this change is not required.
| ) | ||
|
|
||
|
|
||
| $responce = Invoke-RestMethod -Method Get -Uri $($ContainerUrl + $SAS + 'restype=container&comp=list') |
There was a problem hiding this comment.
typo responce -> response
|
|
||
| $responce = Invoke-RestMethod -Method Get -Uri $($ContainerUrl + $SAS + 'restype=container&comp=list') | ||
|
|
||
| $xmlResponce = [xml]$responce.Substring($responce.IndexOf('<EnumerationResults')) # remove some bad chars in the beginning that break XML parsing |
|
|
||
| function Get-DefaultPreviewConfigForPackageValidation | ||
| { | ||
| @{ 'centos7'='rhel.7'; |
There was a problem hiding this comment.
Add a comment about where to get the list of the supported OS for each release
PR Summary
This PR updates tests for package validation.
Primary change is switching from constructing expected package filenames based on PS version to query the Azure Blob for actual packages that it has. This greatly improves reliability and makes test failure diagnostics much easier. This also removes 'special-case-code-paths' that were needed previously when constructing expected package filenames in some cases (e.g. opensuse).
Other updates:
** removed "PSVERSIONSTUB" in favor of "PACKAGENAME" that is found on Azure Blob
** renamed "PACKAGELOCATIONSTUB" to "PACKAGELOCATION"
** added "PREVIEWSUFFIX" that has to be "-preview" for preview packages
** renamed "TESTLISTSTUB" to "TESTLIST"
** removed "GITLOCATION" in favor of "TESTDOWNLOADCOMMAND" to have better control how tests are obtained (e.g. allowing to use PAT)
** removed ubuntu17.10
** added fedora28
** added opensuse42.3
** added ubuntu18.04
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests