-
Notifications
You must be signed in to change notification settings - Fork 41
Add pending reboot reason #873
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
base: main
Are you sure you want to change the base?
Conversation
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 a great change that seems obvious now :)
…yn/operation-methods into add-pending-reboot-reason
Remarks resolved. Sometimes you've to see the obvious first. |
@@ -14,4 +14,21 @@ Describe 'reboot_pending resource tests' { | |||
$LASTEXITCODE | Should -Be 0 | |||
$out.results.result.actualState.rebootPending | Should -Not -BeNullOrEmpty | |||
} | |||
|
|||
It 'reboot_pending should have a reason' -Skip:(!$IsWindows) { | |||
BeforeAll { |
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.
Is using a BeforeAll
within an It
the recommended way over try..finally
?
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.
If it were a single test, I would say that, based on its purpose, it should be added fully at the top. But we have multiple, that's why it's best practice to scope it for the particular test.
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.
I think you misunderstand my question. Per https://pester.dev/docs/commands/beforeall/, the use of BeforeAll
is intended for within a Context
or Describe
where you would have multiple tests (hence the All
). SInce thi s is a single test, it seems better to use the existing pattern of try..finally
.
@@ -14,4 +14,21 @@ Describe 'reboot_pending resource tests' { | |||
$LASTEXITCODE | Should -Be 0 | |||
$out.results.result.actualState.rebootPending | Should -Not -BeNullOrEmpty | |||
} | |||
|
|||
It 'reboot_pending should have a reason' -Skip:(!$IsWindows) { | |||
BeforeAll { |
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.
I think you misunderstand my question. Per https://pester.dev/docs/commands/beforeall/, the use of BeforeAll
is intended for within a Context
or Describe
where you would have multiple tests (hence the All
). SInce thi s is a single test, it seems better to use the existing pattern of try..finally
.
PR Summary
Add a reason field property to indicate why there is a pending reboot. This is for #857
PR Context