Skip to content
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

[windows] Don't fail Windows Update test if an update failed but later succeeded #11253

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions images/windows/scripts/helpers/InstallHelpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ function Get-WindowsUpdateStates {
[PSCustomObject]@{
State = $state
Title = $title
TimeCreated = $event.TimeCreated
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions images/windows/scripts/tests/WindowsFeatures.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ Describe "Windows Updates" {
"$env:windir\WindowsUpdateDone.txt" | Should -Exist
}

$testCases = Get-WindowsUpdateStates | Sort-Object Title | ForEach-Object {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see, yeah this jSON is going to be really long I got you one second.
internal.windows-2025.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to start we going to take this

{
"NodeType": "HeaderNode",
"Title": "Windows Server 2025",
"Children": [
{
"NodeType": "ToolVersionNode",
"ToolName": "OS Version:",
"Version": "10.0.26100 Build 2605"
},
{
"NodeType": "ToolVersionNode",
"ToolName": "Image Version:",
"Version": "20241215.1.0"
},
{
"NodeType": "HeaderNode",
"Title": "Windows updates",
"Children": [
{
"NodeType": "ToolVersionNode",
"ToolName": "Update Title",
"Version": "Some Update",
"TimeCreated": "2024-12-30T12:34:56Z"
},
{
"NodeType": "ToolVersionNode",
"ToolName": "Another Update",
"Version": "Another Update Version",
"TimeCreated": "2024-12-30T12:34:56Z"
}
]
}
]
}

and combine it into the prototype.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
"NodeType": "HeaderNode",
"Title": "Windows Server 2025",
"Children": [
{
"NodeType": "ToolVersionNode",
"ToolName": "OS Version:",
"Version": "10.0.26100 Build 2605"
},
{
"NodeType": "ToolVersionNode",
"ToolName": "Image Version:",
"Version": "20241215.1.0"
},
{
"NodeType": "HeaderNode",
"Title": "Windows updates",
"Children": [
{
"NodeType": "ToolVersionNode",
"ToolName": "Update Title",
"Version": "Some Update",
"TimeCreated": "2024-12-30T12:34:56Z"
},
{
"NodeType": "ToolVersionNode",
"ToolName": "Another Update",
"Version": "Another Update Version",
"TimeCreated": "2024-12-30T12:34:56Z"
}
]
}
]
}

thank you CoPIlot for intergrating this by the way!
https://github.com/bearycool11/pmll_blockchain/blob/main/.devcontainer/internal.windows-2025.json

now turns into this repo's version of this.

$testCases = Get-WindowsUpdateStates | Sort-Object TimeCreated | Group-Object Title | ForEach-Object {
@{
Title = $_.Title
State = $_.State
Title = $_.Group[-1].Title
State = $_.Group[-1].State
}
}

Expand Down