Fix DotNetCoreCLI@2 test command to fail when no project files found #21195
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.
The DotNetCoreCLI@2 task's test command was inconsistently handling missing project files compared to other commands. When no project files matched the specified pattern, the test command would only log a warning and succeed, while other commands (build, restore, pack, push) would properly fail the task.
This dangerous behavior could lead to scenarios where teams believe their tests passed when they actually never ran due to typos in project file paths or missing files.
Problem
Before this fix:
After this fix:
Solution
Changed the
executeTestCommand()
method indotnetcore.ts
to throw an error instead of logging a warning when no project files are found, making it consistent with other dotnet commands.Also updated the corresponding test case to expect task failure instead of success.
This ensures all DotNetCoreCLI commands now behave consistently when project files are not found, preventing silent failures that could mask configuration errors.
Fixes #21193.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
03nvsblobprodwcus014.vsblob.vsassets.io
npm install
(dns block)055vsblobprodwcus02.vsblob.vsassets.io
npm install
(dns block)1g1vsblobprodwcus01.vsblob.vsassets.io
npm install
(dns block)3eavsblobprodwcus03.vsblob.vsassets.io
npm install
(dns block)3zgvsblobprodwcus024.vsblob.vsassets.io
npm install
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)40qvsblobprodwcus022.vsblob.vsassets.io
npm install
(dns block)4fdvsblobprodwcus012.vsblob.vsassets.io
npm install
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)5tbvsblobprodwcus06.vsblob.vsassets.io
npm install
(dns block)61cvsblobprodwcus010.vsblob.vsassets.io
npm install
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)73dvsblobprodwcus07.vsblob.vsassets.io
npm install
(dns block)8usvsblobprodwcus011.vsblob.vsassets.io
npm install
(dns block)9owvsblobprodwcus020.vsblob.vsassets.io
npm install
(dns block)arpvsblobprodwcus017.vsblob.vsassets.io
npm install
(dns block)crcvsblobprodwcus021.vsblob.vsassets.io
npm install
(dns block)fslvsblobprodwcus015.vsblob.vsassets.io
npm install
(dns block)grnvsblobprodwcus04.vsblob.vsassets.io
npm install
(dns block)k92vsblobprodwcus08.vsblob.vsassets.io
npm install
(dns block)mnzvsblobprodwcus05.vsblob.vsassets.io
npm install
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)pl8vsblobprodwcus09.vsblob.vsassets.io
npm install
(dns block)uubvsblobprodwcus018.vsblob.vsassets.io
npm install
(dns block)vwmvsblobprodwcus016.vsblob.vsassets.io
npm install
(dns block)x4wvsblobprodwcus013.vsblob.vsassets.io
npm install
(dns block)xg1vsblobprodwcus019.vsblob.vsassets.io
npm install
(dns block)xlkvsblobprodwcus023.vsblob.vsassets.io
npm install
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.