File tree 4 files changed +6
-16
lines changed
cucumber-core/src/main/java/io/cucumber/core
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/)
10
10
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
11
11
12
12
## [ Unreleased]
13
+ ### Fixed
14
+ - [ Core] Include stack traces in html report ([ #2862 ] ( https://github.com/cucumber/cucumber-jvm/pull/2862 ) M.P. Korstanje)
13
15
14
16
## [ 7.16.0] - 2024-03-21
15
17
### Added
Original file line number Diff line number Diff line change 16
16
<cucumber-expressions .version>17.1.0</cucumber-expressions .version>
17
17
<gherkin .version>28.0.0</gherkin .version>
18
18
<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>
21
21
<tag-expressions .version>6.1.0</tag-expressions .version>
22
22
</properties >
23
23
Original file line number Diff line number Diff line change 10
10
import io .cucumber .plugin .event .TestStepFinished ;
11
11
import io .cucumber .plugin .event .TestStepStarted ;
12
12
13
- import java .io .ByteArrayOutputStream ;
14
- import java .io .PrintStream ;
15
- import java .nio .charset .StandardCharsets ;
16
13
import java .time .Duration ;
17
14
import java .time .Instant ;
18
15
import java .util .UUID ;
@@ -117,7 +114,7 @@ private void emitTestStepFinished(
117
114
118
115
TestStepResult testStepResult = new TestStepResult (
119
116
toMessage (duration ),
120
- result .getError () != null ? extractStackTrace ( result .getError ()) : null ,
117
+ result .getError () != null ? result .getError (). getMessage ( ) : null ,
121
118
from (result .getStatus ()),
122
119
result .getError () != null ? toMessage (result .getError ()) : null );
123
120
@@ -128,12 +125,4 @@ private void emitTestStepFinished(
128
125
toMessage (stopTime )));
129
126
bus .send (envelope );
130
127
}
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
-
139
128
}
Original file line number Diff line number Diff line change 24
24
import java .util .function .Consumer ;
25
25
26
26
import static io .cucumber .cienvironment .DetectCiEnvironment .detectCiEnvironment ;
27
- import static io .cucumber .core .exception .ExceptionUtils .printStackTrace ;
28
27
import static io .cucumber .core .exception .ExceptionUtils .throwAsUncheckedException ;
29
28
import static io .cucumber .core .exception .UnrecoverableExceptions .rethrowIfUnrecoverable ;
30
29
import static io .cucumber .messages .Convertor .toMessage ;
@@ -118,7 +117,7 @@ private void emitTestRunFinished(Throwable exception) {
118
117
bus .send (new TestRunFinished (instant , result ));
119
118
120
119
io .cucumber .messages .types .TestRunFinished testRunFinished = new io .cucumber .messages .types .TestRunFinished (
121
- exception != null ? printStackTrace ( exception ) : null ,
120
+ exception != null ? exception . getMessage ( ) : null ,
122
121
exception == null && exitStatus .isSuccess (),
123
122
toMessage (instant ),
124
123
exception == null ? null : toMessage (exception ));
You can’t perform that action at this time.
0 commit comments