进程在蛋糕执行中返回错误(退出代码-3)

时间:2017-07-05 06:07:22

标签: git cakebuild

执行我正在获得的测试项目的蛋糕脚本时,

    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()

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

-3返回代码dotcover.exe表示正在分析的应用中的退出代码不等于0。 (简单的英语,您的单元测试失败)。请参阅此link

要验证测试是否失败,请尝试单独运行单元测试而不使用DotCover别名。

要继续测试失败,请参阅Cake中的error handling

答案 1 :(得分:0)

Cake只返回底层工具的退出代码,在本例中为DotCover。如果在诊断模式下运行Cake:

How to enable diagnostic verbosity for Cake

您应该能够获取正在执行的确切DotCover命令,然后您可以在命令行手动运行它。此时,输出可能会再次为-3。

我所说的是,这很可能是DotCover分析您的应用程序的问题,而不是Cake的问题。