Skip to content

Fix test failures in Npm and VSCode#292

Merged
AmelBawa-msft merged 4 commits into
mainfrom
user/amelbawa/fix-tests
Jun 9, 2026
Merged

Fix test failures in Npm and VSCode#292
AmelBawa-msft merged 4 commits into
mainfrom
user/amelbawa/fix-tests

Conversation

@AmelBawa-msft

@AmelBawa-msft AmelBawa-msft commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

📖 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

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@AmelBawa-msft

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 4eed5e7. The only conflict was in resources/NpmDsc/NpmDsc.psm1 — combined the array notation from main with our null-check improvements.

@AmelBawa-msft

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft AmelBawa-msft marked this pull request as ready for review June 8, 2026 23:07
@AmelBawa-msft AmelBawa-msft requested a review from Copilot June 9, 2026 19:43
florelis
florelis previously approved these changes Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _logs directory 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.

Comment thread resources/NpmDsc/NpmDsc.psm1 Outdated
Comment thread resources/Microsoft.VSCode.Dsc/Microsoft.VSCode.Dsc.psm1
@AmelBawa-msft

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AmelBawa-msft AmelBawa-msft merged commit 1fca435 into main Jun 9, 2026
4 checks passed
@AmelBawa-msft AmelBawa-msft deleted the user/amelbawa/fix-tests branch June 9, 2026 21:58
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.

5 participants