I’ve got our CI pipeline set up to run tests, but when a test fails, rather than getting a meaningful error like “2 unit tests failed”, we get the following:
Error: The process ‘C:Program Filesdotnetdotnet.exe’ failed with exit code 1
Dotnet command failed with non-zero exit code on the following projects : [ ” ]
Devs would have to go poring through the job console logs to see that actually they just broke a unit test, rather than it being something wrong with the DevOps infrastructure or CI pipeline setup (which is their assumption):
Here’s how the solution is building and running tests:
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore NuGet Packages'
inputs:
command: 'restore'
solution: '$(solution)'
- task: DotNetCoreCLI@2
displayName: 'Build Projects'
inputs:
command: 'build'
solution: '$(solution)'
arguments: '--configuration $(buildConfiguration) --no-restore'
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: 'test'
solution: '$(solution)'
arguments: '--configuration $(buildConfiguration) --no-build --no-restore'
- task: DotNetCoreCLI@2
displayName: 'Publish Deployable Projects'
inputs:
command: 'publish'
etc...
Is something lacking in this setup, or is the DotNetCoreCLI@2 “test” command just not mature in this regard?
I’ve used other pipelines using vstest / mstest commands directly and had nicer output, but I was hoping I could do everything with DotNetCoreCLI@2 for a variety of reasons, such as being able to chain several steps together without having to re-build the solution.