colcon-core icon indicating copy to clipboard operation
colcon-core copied to clipboard

Better exception handling in tests

Open rotu opened this issue 5 years ago • 2 comments

  1. Don't continue with testing if an extension crashes
  2. Use logger.exception to format current traceback in an error

rotu avatar Mar 14 '20 23:03 rotu

Codecov Report

Merging #322 into master will increase coverage by 0.03%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   79.61%   79.65%   +0.03%     
==========================================
  Files          55       55              
  Lines        3209     3209              
  Branches      534      534              
==========================================
+ Hits         2555     2556       +1     
+ Misses        607      606       -1     
  Partials       47       47              
Impacted Files Coverage Δ
colcon_core/task/python/test/__init__.py 26.59% <0.00%> (+0.27%) :arrow_up:
colcon_core/command.py 86.91% <0.00%> (+0.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update af7fa08...f2b3a34. Read the comment docs.

codecov[bot] avatar Mar 14 '20 23:03 codecov[bot]

Don't continue with testing if an extension crashes Use logger.exception to format current traceback in an error

(As mentioned a few times to you already) Please consider creating separate pull requests for orthogonal changes - simply because each can be reviewed and iterated on independently.

Regarding the functional change: a very important design choice / feature of colcon is that a single extension (which can be provided by any package) does rarely result in a fatal error of the tool. In as many cases as possible colcon tries to be resilient, logs the error, but continue to perform the requested operation. Therefore I don't think patch is the right approach to resolve #321.

dirk-thomas avatar Mar 25 '20 21:03 dirk-thomas