Build/Test Issues

Console tool: Abort on build failure?

Started by GreenMoose on 1,818 views

[NCrunch Console Tool v3.20.0.6]
Even if NCrunch bumps into build error the test tasks for other projects continues (and finally returns a Build Failure).
Is there a way to prevent this, i.e. so the build on server fails quickly if it cannot build?
(I have a msbuild step before NCrunch only to fail fast for compile errors, but in this case it compiled fine since it is the path for NCrunch workspace that is too long)


[LocalBuildTask-22] ERROR (Build): Utils.AspNetCore.Common.ExampleWebApi.ApiClienGenTests: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets (5106): Could not write lines to file "obj\Release\netcoreapp2.0\Utils.AspNetCore.Common.ExampleWebApi.ApiClienGenTests.csproj.FileListAbsolute.txt". Could not find a part of the path 'D:\TeamCity\buildAgent\work\d9e94c7a15ae240c\_Tmp\_NCrunch\WC\3448\8\APIs\Utils\AspNetCore\Common\test\Utils.AspNetCore.Common.ExampleWebApi.ApiClienGenTests\obj\Release\netcoreapp2.0\Utils.AspNetCore.Common.ExampleWebApi.ApiClienGenTests.csproj.FileListAbsolute.txt'.


Thanks.
Under the current architecture, the only way I could think of force this kind of behaviour would be to introduce a project dependency from each of your test projects into the unconnected projects that are likely to fail. If the platforms are different, you might be able to work around this by using the Implicit project dependencies setting.

It could be considered abnormal behaviour for NCrunch to stop on the first failure it discovers. The structure of your solution is such that further relevant results could be obtained by continuing the build, so stopping early would seem like a specific requirement that should be declared in advance. By introducing the above project dependencies (physically or virtually through the config), you effectively define your own build sequence and dependency structure and force the build to stop by declaring the error as critical.

Post a reply

Log in to reply.