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

[FAKE 5.7] DotNet.test new dotnet msbuild step can't handle dotnet test arguments #2102

Closed
SteveGilham opened this issue Sep 24, 2018 · 2 comments

Comments

@SteveGilham
Copy link
Contributor

Description

DotNet.test now invokes dotnet.exe twice, once as C:\Program Files\dotnet\dotnet.EXE "msbuild" and once as C:\Program Files\dotnet\dotnet.EXE "test", but the two commands accept different possible sets of arguments.

Repro steps

Script fragment

  let setBaseOptions (o : DotNet.Options) =
    { o with WorkingDirectory = Path.getFullName "./_DotnetTest"
             Verbosity = Some DotNet.Verbosity.Minimal }

  DotNet.test (fun to' -> to'.WithCommon(setBaseOptions))
    "dotnettest.fsproj"

Expected behavior

Expect build output of the form

C:\Program Files\dotnet\dotnet.EXE "test" "--verbosity" "minimal" "dotnettest.fsproj" "--configuration" "Debug" "/nodeReuse:False"
  Restoring packages for C:\Users\steve\Documents\GitHub\altcover\_ApiUse\_DotnetTest\dotnettest.fsproj...

etc.

Actual behavior

The script first emits the dotnet msbuild command with arguments intended for dotnet test, as well as its own /version /nologo

Starting task 'DotNet:test': dotnettest.fsproj
C:\Program Files\dotnet\dotnet.EXE "msbuild" "--verbosity" "minimal" "/version" "/nologo"
MSBUILD : error MSB1001: Unknown switch.
Switch: --verbosity

For switch syntax, type "MSBuild /help"
Could not detect msbuild version from 'C:\Program Files\dotnet\dotnet.EXE msbuild': System.Exception: msbuild failed with exitcode '1'
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1645.Invoke(String message)
   at Fake.DotNet.DotNet.callMsBuildExe@860.Invoke(String args) in D:\a\1\s\src\app\Fake.DotNet.Cli\DotNet.fs:line 865
   at Fake.DotNet.MSBuild.getFromCall@660(String exePath, FSharpFunc`2 callMsbuildExe, Unit unitVar0) in D:\a\1\s\src\app\Fake.DotNet.MSBuild\MSBuild.fs:line 662
msbuild version '13.0.0.0' doesn't support binary logger, pelase set the msbuild argument 'DisableInternalBinLog' to 'true' to disable this warning.

then proceeds as expected.

The guidance supplied in the warning message is not relevant to the actual issue; it also contains a typo ("pelase" rather than "please").

Known workarounds

None so far while passing the desired arguments to the dotnet test step.

Still chasing through the code to try and determine why this extra step even happens for dotnet test but not for the extremely similar dotnet publish, and how thereby to switch it off entirely as unwanted.

Related information

  • Operating system -- WinX Home
  • Branch -- N/A
  • .NET Runtime, CoreCLR or Mono Version -- .net core 2.1.402
  • Indications of severity -- mostly cosmetic
  • Version of FAKE (4.X, 5.X) -- 5.7
@matthid
Copy link
Member

matthid commented Sep 24, 2018

Thanks, yes for reporting. Please use < 5.7 until this has been resolved or remove the Common arguments for now.

Still chasing through the code to try and determine why this extra step even happens for dotnet test but not for the extremely similar dotnet publish, and how thereby to switch it off entirely as unwanted.

This is in order to check the msbuild version to detect if the version is good enough for the recently (5.7) added binary logger which in turn is used to improve build server integration and error/warning reports

@matthid
Copy link
Member

matthid commented Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants