File tree Expand file tree Collapse file tree 4 files changed +6
-16
lines changed
cucumber-core/src/main/java/io/cucumber/core Expand file tree Collapse file tree 4 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1010and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
1111
1212## [ Unreleased]
13+ ### Fixed
14+ - [ Core] Include stack traces in html report ([ #2862 ] ( https://github.com/cucumber/cucumber-jvm/pull/2862 ) M.P. Korstanje)
1315
1416## [ 7.16.0] - 2024-03-21
1517### Added
Original file line number Diff line number Diff line change 1616 <cucumber-expressions .version>17.1.0</cucumber-expressions .version>
1717 <gherkin .version>28.0.0</gherkin .version>
1818 <html-formatter .version>21.3.0</html-formatter .version>
19- <junit-xml-formatter .version>0.2.1 </junit-xml-formatter .version>
20- <messages .version>24.0.1 </messages .version>
19+ <junit-xml-formatter .version>0.3.0 </junit-xml-formatter .version>
20+ <messages .version>24.1.0 </messages .version>
2121 <tag-expressions .version>6.1.0</tag-expressions .version>
2222 </properties >
2323
Original file line number Diff line number Diff line change 1010import io .cucumber .plugin .event .TestStepFinished ;
1111import io .cucumber .plugin .event .TestStepStarted ;
1212
13- import java .io .ByteArrayOutputStream ;
14- import java .io .PrintStream ;
15- import java .nio .charset .StandardCharsets ;
1613import java .time .Duration ;
1714import java .time .Instant ;
1815import java .util .UUID ;
@@ -117,7 +114,7 @@ private void emitTestStepFinished(
117114
118115 TestStepResult testStepResult = new TestStepResult (
119116 toMessage (duration ),
120- result .getError () != null ? extractStackTrace ( result .getError ()) : null ,
117+ result .getError () != null ? result .getError (). getMessage ( ) : null ,
121118 from (result .getStatus ()),
122119 result .getError () != null ? toMessage (result .getError ()) : null );
123120
@@ -128,12 +125,4 @@ private void emitTestStepFinished(
128125 toMessage (stopTime )));
129126 bus .send (envelope );
130127 }
131-
132- private String extractStackTrace (Throwable error ) {
133- ByteArrayOutputStream s = new ByteArrayOutputStream ();
134- PrintStream printStream = new PrintStream (s );
135- error .printStackTrace (printStream );
136- return new String (s .toByteArray (), StandardCharsets .UTF_8 );
137- }
138-
139128}
Original file line number Diff line number Diff line change 2424import java .util .function .Consumer ;
2525
2626import static io .cucumber .cienvironment .DetectCiEnvironment .detectCiEnvironment ;
27- import static io .cucumber .core .exception .ExceptionUtils .printStackTrace ;
2827import static io .cucumber .core .exception .ExceptionUtils .throwAsUncheckedException ;
2928import static io .cucumber .core .exception .UnrecoverableExceptions .rethrowIfUnrecoverable ;
3029import static io .cucumber .messages .Convertor .toMessage ;
@@ -118,7 +117,7 @@ private void emitTestRunFinished(Throwable exception) {
118117 bus .send (new TestRunFinished (instant , result ));
119118
120119 io .cucumber .messages .types .TestRunFinished testRunFinished = new io .cucumber .messages .types .TestRunFinished (
121- exception != null ? printStackTrace ( exception ) : null ,
120+ exception != null ? exception . getMessage ( ) : null ,
122121 exception == null && exitStatus .isSuccess (),
123122 toMessage (instant ),
124123 exception == null ? null : toMessage (exception ));
You can’t perform that action at this time.
0 commit comments