Repository navigation
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow change preserves other error mappings and includes targeted unit and regression coverage.
0 open findings
What changed in this PR
Aligns dsc config test schema-error exit codes with the documented behavior reported in #1736.
Changes:
- Returns exit code 5 for schema errors while preserving code 2 for other execution errors.
- Adds Rust mapping tests and a Windows Registry regression test.
| File | Description |
|---|---|
| dsc/tests/dsc_config_test.tests.ps1 | Tests exit code 5 for an invalid Registry property. |
| dsc/src/subcommand.rs | Maps schema errors to exit code 5 and tests both mappings. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Steve Lee (SteveL-MSFT)
requested changes
Oct 14, 2026
| $log | Should -Match ".*Resource named 'MyTest' for type 'Microsoft.DSC.Debug/Echo' is specified more than once.*" -Because ($log | Out-String) | ||
| } | ||
|
|
||
| It 'Schema validation failures return exit code 5' -Skip:(!$IsWindows) { |
There was a problem hiding this comment.
Can you change this test to use the Echo resource instead so it works cross-platform?
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.
Summary
Evidence
dsc config testreturns 2 for an unknown Registry property.config_testmaps everyinvoke_testerror toEXIT_DSC_ERROR; schema validation errors arrive asDscError::Schema.config_testmapsDscError::Schemato the existingEXIT_VALIDATION_FAILEDvalue (5), while other errors retain code 2. Regression tests cover both mappings and the reported input.git diff --check: passed. Patch policy accepted 2 files with no binary changes.Merge Danger
Door: two-way
Blast Radius: narrow
Only the exit status for schema errors returned by
dsc config testchanges; other errors keep their current code.