JsonMappingException when doing allure:report with big data #2671
Replies: 2 comments
-
I prevented it now by overriding a But maybe that could be configurable somehow. |
Beta Was this translation helpful? Give feedback.
-
The issue is about having a large (20046850 characters) step parameter value. Step parameters are usually added from method arguments when using To deal with the error, the rule of tump is always to consider the possible method arguments when putting the However, since it's not that convenient, there is a way to do it automatically by using Allure LifecycleListener API: import io.qameta.allure.listener.StepLifecycleListener;
import io.qameta.allure.model.Parameter;
import io.qameta.allure.model.StepResult;
import java.util.Objects;
public class StepParameterShortenerListener implements StepLifecycleListener {
private static final int MAX_STEP_PARAMETER_LENGTH = 100;
@Override
public void beforeStepStop(final StepResult result) {
for (final Parameter parameter : result.getParameters()) {
if (Objects.nonNull(parameter.getValue())
&& parameter.getValue().length() > MAX_STEP_PARAMETER_LENGTH) {
parameter.setValue(parameter.getValue().substring(0, MAX_STEP_PARAMETER_LENGTH) + "...");
}
}
}
} Then, you need to register this listener via SPI (for |
Beta Was this translation helpful? Give feedback.
-
The test results of one test all of a sudden do not show up in the Allure report anymore.
The reason is an exception when execution allure:report:
The file "f4d45965-dc7d-471d-8d02-70ed936ac01d-result.json" is 71.3 MB big.
How to solve it? Can the maximum string lenth maybe be configured in order to increase it? Or how to prevent that such a large JSON file is created in the allure-results folder if the HTTP responses can be very big?
Beta Was this translation helpful? Give feedback.
All reactions