Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix too early truncate of feedbacks #34

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class ServerNotificationTransport implements NotificationTransport {
private final ArtifactLinkManager artifactLinkManager = (ArtifactLinkManager) ContainerManager.getComponent("artifactLinkManager");

// Maximum length for the feedback text. The feedback will be truncated afterwards
private static final int FEEDBACK_DETAIL_TEXT_MAX_CHARACTERS = 5000;
private static final int FEEDBACK_MAX_LENGTH = 10_000;

// Maximum number of lines of log per job. The last lines will be taken.
private static final int JOB_LOG_MAX_LINES = 5000;
Expand Down Expand Up @@ -510,8 +510,8 @@ private JSONObject createTestsResultsJSONObject(TestResults testResults, boolean
JSONArray testCaseErrorDetails = new JSONArray();
for (TestCaseResultError testCaseResultError : testResults.getErrors()) {
String errorMessageString = testCaseResultError.getContent();
if (errorMessageString != null && errorMessageString.length() > FEEDBACK_DETAIL_TEXT_MAX_CHARACTERS) {
errorMessageString = errorMessageString.substring(0, FEEDBACK_DETAIL_TEXT_MAX_CHARACTERS);
if (errorMessageString != null && errorMessageString.length() > FEEDBACK_MAX_LENGTH) {
errorMessageString = errorMessageString.substring(0, FEEDBACK_MAX_LENGTH);
}
testCaseErrorDetails.put(errorMessageString);
}
Expand Down