chocolatey / Chocolatey.Cake.Recipe

A set of convention based Cake scripts for building Chocolatey projects
Apache License 2.0
5 stars 9 forks source link

(#91) Defer throwing exceptions on test failures #92

Closed AdmiringWorm closed 1 year ago

AdmiringWorm commented 1 year ago

Description Of Changes

This commit updates the tasks for running unit/integration tests to add an OnError handler so the actual throwing of the exception can be defered to after we have uploaded the test results to any build servers, or when generating local coverage files.

Additionally the unit and coverage results generation continues with any additional tasks if one of these fails.

Motivation and Context

To have test status and coverage reports available even if one or more tests fail.

Testing

  1. Tested by copying the files over to the chocolatey/choco tools directory.
  2. Run the build.
  3. Ensure success
  4. Edit one of the tests to throw an exception (or at least fail)
  5. Run the build again
  6. Ensure build doesn't fail until after the Test task is running.

Change Types Made

Related Issue

Fixes #91

Change Checklist

gep13 commented 1 year ago

@AdmiringWorm thanks for getting this added!