Apply azdo ext best practices for testing and fix mocks#6491
Merged
vhvb1989 merged 16 commits intoJan 12, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Azure DevOps extension testing infrastructure to follow best practices and fix cross-platform compatibility issues. The changes replace direct child_process usage with the proper azure-pipelines-task-lib/toolrunner API, update test mocks to work on both Windows and Linux, clean up deprecated dependencies, and modernize the Node.js runtime support.
Changes:
- Refactored main implementation to use
toolRunnerinstead ofchild_process.execSyncfor better error handling and cross-platform support - Updated test mocks to properly simulate both Windows and Linux/Mac execution environments
- Removed outdated test files and dependencies (Jest, ts-jest, sync-request, js-yaml)
- Updated Node.js runtime from Node10/Node20_1 to Node20_1 only
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ext/azuredevops/setupAzd/index.ts | Refactored to use toolRunner API with proper async/await and error handling |
| ext/azuredevops/setupAzd/tests/success.ts | Updated mock to support both Windows and Linux scenarios |
| ext/azuredevops/setupAzd/tests/successVersion.ts | Updated mock to support both Windows and Linux scenarios |
| ext/azuredevops/setupAzd/tests/invalidVersion.ts | Updated mock to support both Windows and Linux with failure scenarios |
| ext/azuredevops/setupAzd/tests/InstallSuccess.ts | Deleted - old test runner pattern |
| ext/azuredevops/setupAzd/tests/InstallFail.ts | Deleted - old test runner pattern |
| ext/azuredevops/setupAzd/package.json | Removed Jest-related dependencies, updated test script |
| ext/azuredevops/setupAzd/task.json | Removed deprecated Node10 support |
| ext/azuredevops/setupAzd/.gitignore | Added *.log to ignore test logs |
| .vscode/cspell-devops-ext.txt | Added new technical terms |
| ext/azuredevops/setupAzd/package-lock.json | Dependency updates and removals |
JeffreyCA
approved these changes
Jan 12, 2026
Member
Author
|
/check-enforcer override |
weikanglim
reviewed
Jan 12, 2026
weikanglim
approved these changes
Jan 12, 2026
Contributor
weikanglim
left a comment
There was a problem hiding this comment.
Looks great! Thanks for taking the time to add mockable tests and cleaning up the package dependencies -- this is extremely useful for maintenance going forward!
tg-msft
approved these changes
Jan 12, 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.
Improves Azure DevOps extension testing by applying best practices and fixing mocks to work on both Windows and Linux (previously only compatible with Linux).