Repository navigation
Quote wildcard filters passed to dsc in argument tests - #1784
Merged
Steve Lee (SteveL-MSFT) merged 1 commit intoNov 2, 2026
Merged
Steve Lee (SteveL-MSFT) merged 1 commit into
Steve Lee (SteveL-MSFT) merged 1 commit into
Conversation
Outside Windows, PowerShell expands wildcards in unquoted arguments of native commands against the current directory. When the tests run from the repository root, `-a Test*` became `-a tests`, which dsc rejects, and the adapter filter test passed without checking any resource. Quote the filters and check that the test finds resources. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the DSC argument-test changes.
No open issues 🎉
What changed in this PR
This PR makes DSC argument tests more reliable by preventing PowerShell wildcard expansion on Linux and macOS and detecting adapter-listing failures.
Changes:
- Quotes wildcard resource and adapter filters, including the Windows-only tracing test.
- Adds exit-code and nonempty-result assertions so the adapter filter test cannot pass without returning resources.
| File | Description |
|---|---|
dsc/tests/config/dsc_args.tests.ps1 |
Quotes wildcard filters and strengthens adapter filter assertions. |
Review effort: Balanced
Christian Pfeiffer (ChrisTX)
added a commit
to ChrisTX/aur-packages
that referenced
this pull request
Nov 2, 2026
- The quoted adapter filter is PowerShell/DSC#1784 upstream Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arch Linux Technical User (archlinux-github)
pushed a commit
to archlinux/aur
that referenced
this pull request
Nov 2, 2026
- The quoted adapter filter is PowerShell/DSC#1784 upstream Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steve Lee (SteveL-MSFT)
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
On Linux and macOS, PowerShell expands wildcards in unquoted arguments of native commands, matching file names in the current directory without regard to case. The test
verify `dsc resource list * adapter_filter`indsc/tests/config/dsc_args.tests.ps1runsWhen the tests run from the repository root,
Test*matches thetestsfolder, so dsc gets-a testsand fails:The test still passes. It only checks the resources that come back, and none do.
This PR:
dsc_args.tests.ps1, as the test above it already does with'*'Test/AdapterandTest/TestGroup.The test on line 169 only runs on Windows, where PowerShell doesn't expand the arguments. I quoted it as well so that the file is consistent.
PR Context
With the filter unquoted, the new checks fail on Linux (
Expected 0, but got 2). With it quoted, both adapter filter tests pass.🤖 Generated with Claude Code