asmagin / Cake.Sitecore

The library provides a set of pre-build CAKE tasks. Those tasks could be used to simplify a configuration of CI/CD for Helix-based Sitecore projects.
https://cakebuild.net/addins/sitecore/
MIT License
11 stars 12 forks source link

Unit test execution task returns lastexitcode=0 in case of failed unit test. #31

Closed artyom-krot closed 6 years ago

artyom-krot commented 6 years ago

For now Unit test execution failure could be caught in MergeCoverageReportsTask. if (Sitecore.Variables.UnitTestsFailed) { throw new Exception("One or more tests are failing"); }

If we do not run MergeCoverageReportsTask, but Unit tests failed in RunServerUnitTestsTask or in RunClientUnitTestsTask, we will not get failure at the end.

artyom-krot commented 6 years ago

Solution TO add additional boolean parameter, with the help of which we can control if we want to fail unit tests immediately or only on the step MergeCoverageReportsTask