1

While executing the cake script for test projects i'm getting,

    An error occurred when executing task 'test'.
    Error: System.Exception: DotCover: Process returned an error (exit code -3).
       at Submission#0.<.ctor>b__29(Exception exception)
       at Cake.Core.DefaultExecutionStrategy.HandleErrors(Action`1 action, Exception exception)
       at Cake.Core.CakeEngine.HandleErrors(IExecutionStrategy strategy, Action`1 errorHandler, Exception exception)
       at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report)
       at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
       at Cake.Scripting.BuildScriptHost.RunTarget(String target)
       at Submission#0.<.ctor>b__31()
       at Cake.Core.ActionTask.Execute(ICakeContext context)
       at Cake.Core.DefaultExecutionStrategy.Execute(CakeTask task, ICakeContext context)
       at Cake.Core.CakeEngine.ExecuteTask(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report)
       at Cake.Core.CakeEngine.RunTarget(ICakeContext context, IExecutionStrategy strategy, String target)
       at Cake.Scripting.BuildScriptHost.RunTarget(String target)
       at Submission#0..ctor(Session session, Object& submissionResult)
       at Submission#0.<Factory>(Session session)
       at Roslyn.Scripting.CommonScriptEngine.Execute[T](String code, String path, DiagnosticBag diagnostics, Session session, Boolean isInteractive)
       at Roslyn.Scripting.Session.Execute(String code)
       at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
       at Cake.Commands.BuildCommand.Execute(CakeOptions options)
       at Cake.CakeApplication.Run(CakeOptions options)
       at Cake.Program.Main()

How can i solve this problem?

Vinoth
  • 75
  • 7

2 Answers2

2

Return code -3 from dotcover.exe indicates that the exit code in the application being analysed isn't equal to 0. (plain English, your Unit Tests are failing). See this link.

To verify if tests are failing, try running unit tests separately without DotCover alias.

To continue even thoug tests are failing, see error handling in Cake

bjorkstromm
  • 423
  • 2
  • 5
0

Cake simply returns the exit code from the underlying tool, in this case DotCover. If you run Cake in diagnostic mode:

How to enable diagnostic verbosity for Cake

You should be able to grab the exact DotCover command that is being executed, and then you can run it manually at the command line. At which point, the output will likely again be -3.

What I am saying is, this is most likely an issue with DotCover analysing your application, rather than an issue with Cake.

Gary Ewan Park
  • 17,610
  • 5
  • 42
  • 60