Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: DotNetCoreCLI@ Test with parameter publishTestResults=true appends additional --results-directory regardless #20731

Closed
4 of 7 tasks
abatishchev opened this issue Dec 15, 2024 · 0 comments
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug triage

Comments

@abatishchev
Copy link

abatishchev commented Dec 15, 2024

New issue checklist

Task name

DotNetCoreCLI

Task version

2.247.3

Issue Description

The following YAML task:

- task: DotNetCoreCLI@2
  inputs:
    command: test
    projects: '$(RepoRoot)\src\**\*.Tests.*.csproj'
    arguments: '--no-restore --no-build --configuration ${{ parameters.configuration }} --settings "$(RepoRoot)\.runsettings" --filter TestCategory!=Integration --blame --collect:"XPlat Code Coverage" --logger trx --results-directory "$(Agent.TempDirectory)\TestResults\"'
    publishTestResults: true // <-- !

Fails with the following error:

##[error]Error: The process 'C:\__t\dotnet\dotnet.exe' failed with exit code 1
C:\__t\dotnet\dotnet.exe test C:\__w\1\s\src\MyProject.Tests.Unit.csproj --logger trx --results-directory C:\__w\_temp --no-restore --no-build --configuration Release --settings C:\__w\1\s\.runsettings --filter TestCategory!=Integration --blame "--collect:XPlat Code Coverage" --logger trx --results-directory "C:\__w\_temp\TestResults\""
Option '--results-directory' expects a single argument but 2 were provided.

Because the parameter --results-directory was passed twice:

  1. Explicitly by the user: --results-directory "C:\__w\_temp\TestResults\
  2. Implicitly by the task: --results-directory C:\__w\_temp

Can it be smarter and not do it if it was already passed?

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)

N/A

Operation system

Windows

Full task logs with system.debug enabled

Full debug logs.txt.zip

@v-schhabra v-schhabra added Area: ABTT Akvelon Build Tasks Team area of work and removed Area: Release labels Dec 16, 2024
@abatishchev abatishchev closed this as not planned Won't fix, can't repro, duplicate, stale Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ABTT Akvelon Build Tasks Team area of work bug triage
Projects
None yet
Development

No branches or pull requests

2 participants