Skip to content

Replace Pester -Pending with -Skip in rule tests - #2208

Draft
Andy Jordan (andyleejordan) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-pending-test-failures
Draft

Andy Jordan (andyleejordan) with Copilot wants to merge 5 commits into
mainfrom
copilot/fix-pending-test-failures

Conversation

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Pester v6 removed the It -Pending parameter, but two rule tests still used it, causing test run failures unrelated to whatever change is under test.

Changes

  • Tests/Rules/UseIdenticalMandatoryParametersForDSC.tests.ps1: -pending-skip.
  • Tests/Rules/UseToExportFieldsInManifest.tests.ps1: -pending:($IsCoreClr)-skip:($IsCoreCLR), also correcting the casing of the automatic variable.
# before
It "suggests corrections for AliasesToExport with wildcard" -pending:($IsCoreClr) {

# after
It "suggests corrections for AliasesToExport with wildcard" -skip:($IsCoreCLR) {

Behavior is unchanged — both tests remain unexecuted, now via the supported parameter. A Pester discovery-only run reports Skip=True for both, and no other -Pending usages remain in the PowerShell test files.

Co-authored-by: andyleejordan <2226434+andyleejordan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test failures due to removed -Pending in Pester v6 Replace Pester -Pending with -Skip in rule tests Aug 21, 2026
@bergmeister

Copy link
Copy Markdown
Collaborator

kicked off tests, ok with code change. Copilot can you please resolve merge conflicts

…est-failures

# Conflicts:
#	Tests/Rules/UseIdenticalMandatoryParametersForDSC.tests.ps1
#	Tests/Rules/UseToExportFieldsInManifest.tests.ps1

Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

kicked off tests, ok with code change. Copilot can you please resolve merge conflicts

Merged origin/main and resolved the conflicts in 85463f9.

Both conflicts were in the same two lines this PR touches — main has since landed an equivalent -Pending-Skip change, so I resolved by taking main's version (-Skip / -Skip:($IsCoreClr)). The branch tree is now identical to origin/main, i.e. git diff origin/main is empty, so this PR no longer carries any change of its own and can be closed unless you want to keep the merge commit for history. Pester discovery still reports both tests as skipped.

@bergmeister

Copy link
Copy Markdown
Collaborator

Copilot diff shows no changes at all in this PR, did you undo your work when you resolved merge conflict?

Copilot AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Copilot diff shows no changes at all in this PR, did you undo your work when you resolved merge conflict?

No, nothing was undone — the same fix landed on main independently while this PR was open, so there's genuinely nothing left for it to change.

The commit on main is faad3a4, "Upgrade Pester to version 6.0.1 in CI workflow and documentation (#2194)" by Liam Peters (2026-08-26). Its diff includes exactly the two lines this PR targeted:

-        It "Should find a violations" -pending {
+        It "Should find a violations" -Skip {
-        It "suggests corrections for AliasesToExport with wildcard" -pending:($IsCoreClr) {
+        It "suggests corrections for AliasesToExport with wildcard" -Skip:($IsCoreClr) {

That's why the merge conflicted on those exact lines and only those lines: both sides changed -pending-Skip, differing only in casing. I resolved in favour of main's version rather than re-introducing a purely cosmetic casing difference, which is what leaves the PR diff empty.

Current state on this branch — git diff origin/main is empty, the files contain -Skip / -Skip:($IsCoreClr), and a repo-wide search finds no remaining It -Pending usages (the only Pending hits are unrelated -PendingClientTimeoutInSeconds entries in Engine/Settings/*.json).

So the issue is already fixed on main via #2194, and this PR can be closed as superseded. If you'd rather it carry a change of its own, the only thing left is the cosmetic $IsCoreClr$IsCoreCLR casing fix for the automatic variable — say the word and I'll push that.

@bergmeister

Copy link
Copy Markdown
Collaborator

Copilot diff shows no changes at all in this PR, did you undo your work when you resolved merge conflict?

No, nothing was undone — the same fix landed on main independently while this PR was open, so there's genuinely nothing left for it to change.

The commit on main is faad3a4, "Upgrade Pester to version 6.0.1 in CI workflow and documentation (#2194)" by Liam Peters (2026-08-26). Its diff includes exactly the two lines this PR targeted:

-        It "Should find a violations" -pending {
+        It "Should find a violations" -Skip {
-        It "suggests corrections for AliasesToExport with wildcard" -pending:($IsCoreClr) {
+        It "suggests corrections for AliasesToExport with wildcard" -Skip:($IsCoreClr) {

That's why the merge conflicted on those exact lines and only those lines: both sides changed -pending-Skip, differing only in casing. I resolved in favour of main's version rather than re-introducing a purely cosmetic casing difference, which is what leaves the PR diff empty.

Current state on this branch — git diff origin/main is empty, the files contain -Skip / -Skip:($IsCoreClr), and a repo-wide search finds no remaining It -Pending usages (the only Pending hits are unrelated -PendingClientTimeoutInSeconds entries in Engine/Settings/*.json).

So the issue is already fixed on main via #2194, and this PR can be closed as superseded. If you'd rather it carry a change of its own, the only thing left is the cosmetic $IsCoreClr$IsCoreCLR casing fix for the automatic variable — say the word and I'll push that.

Andy Jordan (@andyleejordan) it seems your PR has been superseded by #2194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The only test failures are due to -Pending (removed in Pester v6) still used in 2 rule tests unrelated to this PR

3 participants