I'm a maintainer for FSharp.Charting. Recently our FAKE testing rules started breaking with the error reported below (specifically I'm calling build.cmd RunTests
). FAKE seems to be picking up the incorrect path and exe name for nunit-console, which is at packages/NUnit.ConsoleRunner/tools/nunit3-console.exe. I'm not sure whether this is a versioning issue or if I need to update my build.fsx script to account for changes to FAKE and/or NUnit. Any guidance would be appreciated.
System.Exception: Start of process c:\GitHub\FSharp.Charting_20180310\tools\Nunit\nunit-console.exe failed. The system cannot find the file specified
at [email protected](String message) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 91
at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc2 errorF, FSharpFunc2 messageF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 91
at Fake.NUnitSequential.NUnit(FSharpFunc2 setParams, IEnumerable1 assemblies) in C:\code\fake\src\app\FakeLib\UnitTest\NUnit\Sequential.fs:line 26
at [email protected](Unit _arg6) at Fake.TargetHelper.runSingleTarget(TargetTemplate1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626
Some relevant contents of paket.lock:
FAKE (4.61.3) - framework: net40, net45, net461
NUnit (3.7.1) - framework: net40, net45, net461
NUnit.ConsoleRunner (3.6.1) - framework: net40, net45, net461
NUnit.Runners (3.6.1) - framework: net40, net45, net461
NUnit.ConsoleRunner (>= 3.6.1) - framework: net40, net45, net461
EDIT: fixed the build.cmd test command, and provided the explicit nunit-console path.
Per additional comments from @Charles Mager, there are two potential solutions:
Thanks to @TeaDrivenDev I figured out there's a version misalignment between FAKE (v4) and NUnit which was unconstrained to download the latest v3 stable. This can be accomplished by clamping NUnit and NUnit.Runners in paket.dependencies to 2.6.3 or above, up to <3.0.
Update build.fsx to use NUnit3. This involved open Fake.Testing
and updating the NUnit call to NUnit3. In addition, some of the NUnit parameter names have been updated or deprecated. Full details of this approach can be found here.
I opted for solution 2 since it keeps us up to date with the current NUnit.