Skip to content

Commit

Permalink
Fix status calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Nov 4, 2024
1 parent f558699 commit d5d779a
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,13 +757,12 @@ protected void createSkippedSteps(ExtensionContext context, Throwable cause) {
* @param status a test item execution result
* @return Request to ReportPortal
*/
@SuppressWarnings("unused")
@Nonnull
protected FinishTestItemRQ buildFinishTestRq(@Nonnull ExtensionContext context, @Nullable ItemStatus status) {
FinishTestItemRQ rq = new FinishTestItemRQ();
ItemStatus myStatus = ofNullable(status).orElseGet(() -> getExecutionStatus(context));
Optional<Throwable> myException = context.getExecutionException();
if (status != ItemStatus.PASSED && myException.isPresent()) {
if (myStatus != ItemStatus.PASSED && myException.isPresent()) {
String stepDescription = createStepDescription(context, STEP);
String stackTrace = String.format(DESCRIPTION_TEST_ERROR_FORMAT, getStackTrace(myException.get(), new Throwable()));
String description = !stepDescription.trim().isEmpty() ? MarkdownUtils.asTwoParts(stepDescription, stackTrace) : stackTrace;
Expand Down

0 comments on commit d5d779a

Please sign in to comment.