spacetelescope / pandokia

Regression tests framework.
Other
2 stars 4 forks source link

tra_exception print out too long #25

Closed oiintam closed 6 years ago

oiintam commented 6 years ago

Here is one of the example: https://ssb.stsci.edu/pandokia/pandokia.cgi?query=detail&key_id=151658014

The test is using nose, which will trigger nose_plugin.py when run. Please let me know if more information is needed.

cdsontag commented 6 years ago

Specifically, the exception created by the test code is really only one line:

There were 2 unintended error types found

But the exception being put into tra_exception is wayyyy more:

There were 2 unintended error types found -------------------- >> begin captured stdout << 
--------------------- pandeia_data is: /installations/test_1/src/pandeia_data pandeia is: /installations
/test_1/src/pandeia branch is: master host is: test1-jwst.etc.stsci.edu user is: etc_service install_dir
is: /installations/test_1 AWS_PATH is: /opt/aws 
_____________________________________________________________________________________________________
___________________________________________________________ Occurs 9 times: Latest example found in: 
<elasticsearch> Is _AT LEAST_ 0.0 days old error An unexpected error occured while creating a plot 
2018-06-06T18:07:51.783Z branch = master, user_id = 247 https://test1-jwst.etc.stsci.edu
/workbook.html?wb_id=1279# <no stack yet> 
____________________________________________________________________________________________________
____________________________________________________________ Occurs 17 times: Latest example
found in: <elasti...

as if it just added the test's stdout onto the end of the exception for some reason.

jhunkeler commented 6 years ago

https://github.com/spacetelescope/pandokia/blob/e0ba7b07aa3c55854c9d1bd5bea0c1ac67144891/pandokia/helpers/nose_plugin.py#L205-L249

test.exc_info() (sys.exc_info() under the hood) in Python 3 wasn't returning any traceback information whatsoever, so I rewrote write_report to utilize nose's internal traceback handling, rather than python's.

I can only assume no one noticed this change because our tests were mostly running under pytest, and the remaining nose tests we were concerned about didn't generate huge (enough) tracebacks for this to trigger any alarms.

Sorry about that.