Skip to content

Commit

Permalink
Failing case number fix, capping table payload size
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAmg committed Aug 9, 2024
1 parent d500619 commit a5d6172
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void runTests(TestConfig testconfig) {
logger.info("\n " + resultSummary.getMode() + " Mode ->" + "\n"
+ " Total number of cases run : " + resultSummary.getNumberOfCases() + "\n"
+ " Number of Failing cases : " + resultSummary.getFailingCasesCount() + "\n"
+ " Failing tests (Row numbers) : " + resultSummary.getFailingCases().toString());
+ " Failing tests (Row numbers) : " + resultSummary.getFailingCaseNumbers().toString());
if (resultSummary.getFailingCasesCount() > 0) {
overallStatus = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private static String generateFailingCaseSummary(AssertionDetails assertionDetai
.append("<summary> Case ID : ").append(assertionDetails.getCaseId()).append("</summary>\n\n")
.append("| Operation Type | ").append(assertionDetails.getAssertionType()).append(" |\n")
.append("|----------------|------|\n")
.append("| Expected | ").append(assertionDetails.getExpected()).append("| \n")
.append("| Actual | ").append(assertionDetails.getActual()).append("| \n\n")
.append("| Expected | ").append(capSize(assertionDetails.getExpected())).append("| \n")
.append("| Actual | ").append(capSize(assertionDetails.getActual())).append("| \n\n")
.append("</details></li>\n\n").toString();
}

Expand Down Expand Up @@ -91,4 +91,11 @@ private static String generatePieChart(TestResultSummary testResultSummary) {
.append("</details>").append("\n\n");
return pieChartBuilder.toString();
}

private static String capSize(String payload) {
if (payload.length() > 10000) {
return "Too large to show here, please refer to Logs";
}
return payload;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.unlogged.autoexecutor.testutils.entity;

import java.util.List;
import java.util.stream.Collectors;

public class TestResultSummary {
private int numberOfCases;
Expand Down Expand Up @@ -40,4 +41,8 @@ public void setMode(String mode) {
public List<AssertionDetails> getFailingCases() {
return failingCases;
}

public List<Integer> getFailingCaseNumbers() {
return failingCases.stream().map(AssertionDetails::getCaseId).collect(Collectors.toList());
}
}

0 comments on commit a5d6172

Please sign in to comment.