Fix test failures in Npm and VSCode#292
Merged
Merged
Conversation
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
Merge conflicts resolved in commit |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
florelis
previously approved these changes
Jun 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce test flakiness and improve error handling in the Npm and VSCode DSC modules by making command execution failures easier to detect and diagnose.
Changes:
- Updated NpmDsc log cache path resolution to derive the
_logsdirectory from npm’s configured cache root. - Reworked
NpmPackage.WhatIf()to rely on exceptions (instead of$LASTEXITCODE) for dry-run failure handling. - Simplified VSCode CLI invocation failure detection to rely on process exit codes and improved the failure message details.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| resources/NpmDsc/NpmDsc.psm1 | Adjusts npm log-path discovery and updates WhatIf handling to use exceptions for dry-run failures. |
| resources/Microsoft.VSCode.Dsc/Microsoft.VSCode.Dsc.psm1 | Changes VSCode invocation error detection to rely on exit codes and improves error detail selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yao-msft
approved these changes
Jun 9, 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.
📖 Description
This PR improves reliability and error handling in the VSCode and Npm DSC PowerShell modules. It simplifies VSCode command execution by relying on exit codes with clearer error messages, strengthens NPM cache path resolution, and makes WhatIf() behavior more robust by handling dry-run failures through exceptions instead of $LASTEXITCODE.
🔗 References
🔍 Validation
✅ Checklist
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow