如何在C#中为发布配置禁用堆栈跟踪

时间:2019-03-25 15:38:44

标签: stack-trace

我已经为HttpWebRequest编写了specflow测试。当我在teamcity服务器中运行它们时,对于每个失败的断言,我都会得到堆栈跟踪。我不希望在日志中报告堆栈跟踪。我使用release configuartion来运行测试,并使用vstestconsole作为测试运行程序。...感谢您的解决方案。

Assert.AreEqual failed. Expected:<404 Not Found>. Actual:<200 OK>. Status "200 OK" returned by request does not match with expected status of "404 Not Found"

[15:22:39][Step 3/3] Stack Trace:
[15:22:39][Step 3/3]    at abc.API.xyz.Tests.Steps.GeneralSteps.CheckStatusCode(String statusCode)
[15:22:39][Step 3/3]    at lambda_method(Closure , IContextManager , String )
[15:22:39][Step 3/3]    at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
[15:22:39][Step 3/3]    at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments)
[15:22:39][Step 3/3]    at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
[15:22:39][Step 3/3]    at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()```


0 个答案:

没有答案