I have two build steps in my build configuration: Visual Studio (sln) build runner, followed by an FxCop build runner. I'm using TeamCity 6.0.1 and FxCop 10.0.
Out of the box, the FxCop runner in TeamCity seems to only report on rule violations, and produces a report on a Code Inspection tab. I want to ensure that if any violation occurs that the build step fails and thus causes an entire build failure.
Is there a way to accomplish this?
Please set the Errors limit property in your FxCop build step configuration to 0. This should break the build if there is at least one analysis error.
Furthermore, there is a similar Warnings limit property. If you don't want to allow any rule violation at warning level, insert in this field also the value 0. If you want to allow rule violations where the rule attribute BreaksBuild == False, leave this property empty.
I've tried that using TeamCity 6.0 (build 15772) and FxCop 10.0.
[14:39:22]: [Step 2/2] Importing inspection results
[14:39:22]: [Step 2/2] Errors limit reached: found 8 errors, limit 0
[14:39:22]: [Step 2/2] ##teamcity[buildStatus status='FAILURE' text='Errors: 8, warnings: 1']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With