Test report: print system identification in stacktrace jv stx-8.0.0
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 19 Aug 2017 14:43:15 +0100
branchjv
changeset 335a7f6c7bc62a8
parent 327 113031dfa759
child 528 32e722badd92
Test report: print system identification in stacktrace

Unfortunately, Jenkins's JUnit plugin does not show nor sort failed
tests based on their report. This workaround make it easier.
reports/Builder__TestReportFormat.st
     1.1 --- a/reports/Builder__TestReportFormat.st	Sat Mar 11 21:41:58 2017 +0000
     1.2 +++ b/reports/Builder__TestReportFormat.st	Sat Aug 19 14:43:15 2017 +0100
     1.3 @@ -342,7 +342,7 @@
     1.4                  message := 'unknown exception occurred (no exception details available)'
     1.5              ] ifFalse:[
     1.6                  type := exception class name.
     1.7 -                message := exception messageText ifNil:[ exception description ].
     1.8 +                message := exception messageText notNil ifTrue:[ exception description ] ifFalse:[ 'no exception'].
     1.9              ].
    1.10  
    1.11  
    1.12 @@ -353,6 +353,13 @@
    1.13                  nextPutAll:'" message="';
    1.14                  nextPutAll:(self encode: message);
    1.15                  nextPutAll:'"><!![CDATA['; cr.
    1.16 +            "/ Write system identification here so one can tell on which system                     
    1.17 +            "/ it failed. Jenkins JUnit plugin infortunately does not show this
    1.18 +            "/ info in it's own UI
    1.19 +            self writeCDATA: ('Hostname: ' , OperatingSystem getHostName , Character cr).
    1.20 +            self writeCDATA: ('OS:       ' , OperatingSystem osName , Character cr).
    1.21 +            self writeCDATA: ('Arch:     ' , OperatingSystem getCPUType , Character cr, Character cr).
    1.22 +                
    1.23              self writeCDATA: (stacktrace ? 'stacktrace not available').
    1.24              stream
    1.25                  nextPutAll:']]></'; nextPutAll: result; nextPutAll:'>';
    1.26 @@ -374,7 +381,7 @@
    1.27      stream flush
    1.28  
    1.29      "Created: / 03-08-2011 / 19:42:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.30 -    "Modified: / 16-09-2014 / 18:55:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.31 +    "Modified: / 19-08-2017 / 14:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.32  ! !
    1.33  
    1.34  !TestReportFormat::JUnit methodsFor:'writing - utilities'!