-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Updates to Docker package tests #7667
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Fixed.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a $null = before New-Item
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.
Updated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo responce -> response
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.
updated
|
|
||
| $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 |
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.
same typo
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.
updated
|
|
||
| function Get-DefaultPreviewConfigForPackageValidation | ||
| { | ||
| @{ 'centos7'='rhel.7'; |
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.
Add a comment about where to get the list of the supported OS for each release
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.
Good point. Updated.
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