Dotnet runner - Build Failure Conditions
Hi,
We have a build step that invokes the dotnet runner to perform a build operation. As part of the project configuration we have setup a failure condition for "number of inspection warning" is more than 0. The option "Immediately stop build if it fails due to the condition" is enabled as well.
When the "dotnet build" step is completed I can see a warning in the build log but the step does not fail and continues to the next step.
How do I break the build if warnings are detected as part of the "dotnet build"
Regard
Rajesh
Please sign in to leave a comment.
Hi Rajesh,
could you please share a screenshot of your build failure condition?
Hi Denis
Please find attached screenshot.
Also when using "dotnet test" and a test case fails the build continues to the next step even when the Exit code is 1
Regards
Rajesh
Hi Rajesh,
thanks for the screenshot. Are the build steps configured to run only if the previous steps are successful? While failure conditions allow to stop the full build, if the steps are properly configured, they won't run anyway if they aren't configured as such.
Hi Denis
Yes all steps are configured to run only when the previous steps are successful. Please see the screenshots below for the example
You can see in the above screenshot Step 5 has the setting "if all previous steps are successful" and below is the screenshot from BuildLog
We can clearly see that the test case execution step 4 has failed and the exit code is 1 and still Step 5 (pack) runs without being ignored.
Below is the screenshot when the build does not fail inspite of having build warnings and the test execution step 4 still runs.
Regards
Rajesh
Hi
Try defining the field `Execute step:` as `Only if build status is successful` for all steps which should not be executed in your case