Skip to content

[BUG]: DotNetCoreCLI@2 doesn't fail when asked to run tests that don't exist #21193

@rolfbjarne

Description

@rolfbjarne

New issue checklist

Task name

DotNetCoreCLI@2

Task version

2

Issue Description

This:

- task: DotNetCoreCLI@2
  displayName: 'dotnet test'
  inputs:
    command: 'test'
    projects: garbage.dll

does not fail, instead it will warn with "Project file(s) matching the specified pattern were not found.".

I found multiple related issues where people have run into this unintuitive and dangerous behavior:

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

All

Relevant log output

> ##[warning]Project file(s) matching the specified pattern were not found.

Full task logs with system.debug enabled

No response

Repro steps

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions