Skip to content

Commit

Permalink
Fix too early truncate of feedbacks (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
Strohgelaender authored Jul 18, 2023
1 parent fb4f36e commit cc0e5b7
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit cc0e5b7

Please sign in to comment.