Skip to content

Bug: -c alias for Incrementalist --config and -c for dotnet -c get confused by CLI parser #407

@Aaronontheweb

Description

@Aaronontheweb

Reproduction:

 - template: azure-pipeline.template.yaml
    parameters:
      name: "netfx_tests_windows"
      displayName: ".NET Framework Unit Tests (Windows)"
      vmImage: "windows-latest"
      command: "dotnet incrementalist run --c .incrementalist/testsOnly.json -- test -c Release --framework net48 --logger:trx --results-directory TestResults"
      outputDirectory: "TestResults"
      artifactName: "netfx_tests_windows-$(Build.BuildId)"

Produces the following error:

info: Incrementalist.Cmd.Program[0]
      Executing 'dotnet test Release --framework net8 --logger:trx --results-directory TestResults /home/vsts/work/1/s/src/Akka.sln' for /home/vsts/work/1/s/src/Akka.sln
MSBUILD : error MSB1008: Only one project can be specified.
    Full command line: '/opt/hostedtoolcache/dotnet/sdk/8.0.403/MSBuild.dll -maxcpucount -verbosity:m -nologo -target:Restore -nodereuse:false -nologo -property:VSTestLogger="trx" -property:VSTestResultsDirectory="/home/vsts/work/1/s/TestResults" Release /home/vsts/work/1/s/src/Akka.sln -property:VSTestArtifactsProcessingMode=collect -property:VSTestSessionCorrelationId=2050_fd66238b-99e0-445b-96a5-78c74948a78d -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/opt/hostedtoolcache/dotnet/sdk/8.0.403/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/opt/hostedtoolcache/dotnet/sdk/8.0.403/dotnet.dll'
  Switches appended by response files:

Doesn't throw any kind of parsing error at all - the -c just gets omitted after the --

Workaround

Changing from -c to --config solves the problem:

 - template: azure-pipeline.template.yaml
    parameters:
      name: "netfx_tests_windows"
      displayName: ".NET Framework Unit Tests (Windows)"
      vmImage: "windows-latest"
      command: "dotnet incrementalist run --config .incrementalist/testsOnly.json -- test -c Release --framework net48 --logger:trx --results-directory TestResults"
      outputDirectory: "TestResults"
      artifactName: "netfx_tests_windows-$(Build.BuildId)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfigAll items related to Incrementalist configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions