Skip to content

Commit

Permalink
Change truncation handling. Bump version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleiss committed Oct 26, 2019
1 parent 6d0a8bd commit 92cb7e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.tum.in.www1</groupId>
<artifactId>bamboo-server</artifactId>
<version>1.1.4</version>
<version>1.1.5</version>
<organization>
<name>LS1 TUM</name>
<url>http://www1.in.tum.de/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public class ServerNotificationTransport implements NotificationTransport

private VariableDefinitionManager variableDefinitionManager = (VariableDefinitionManager) ContainerManager.getComponent("variableDefinitionManager"); // Will be injected by Bamboo

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

public ServerNotificationTransport(String webhookUrl,
@Nullable ImmutablePlan plan,
@Nullable ResultsSummary resultsSummary,
Expand Down Expand Up @@ -288,9 +291,11 @@ private JSONObject createTestsResultsJSONObject(TestResults testResults, boolean
if (addErrors) {
JSONArray testCaseErrorDetails = new JSONArray();
for(TestCaseResultError testCaseResultError : testResults.getErrors()) {
String content = testCaseResultError.getContent();
content = content.substring(0, Math.min(content.length(), 5000));
testCaseErrorDetails.put(content);
String errorMessageString = testCaseResultError.getContent();
if(errorMessageString != null && errorMessageString.length() > FEEDBACK_DETAIL_TEXT_MAX_CHARACTERS) {
errorMessageString = errorMessageString.substring(0, FEEDBACK_DETAIL_TEXT_MAX_CHARACTERS);
}
testCaseErrorDetails.put(errorMessageString);
}
testResultsJSON.put("errors", testCaseErrorDetails);
}
Expand Down

0 comments on commit 92cb7e0

Please sign in to comment.