Skip to content

Commit

Permalink
use dataFailure in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
idegtiarenko committed Dec 9, 2024
1 parent a59ddb0 commit 7609278
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,13 @@ public static void assertData(
}
}

var delta = actualRow.size() - expectedRow.size();
if (delta > 0) {
fail("Plan has extra columns, returned [" + actualRow.size() + "], expected [" + expectedRow.size() + "]");
if (actualRow.size() != expectedRow.size()) {
dataFailure(
"Plan has extra columns, returned [" + actualRow.size() + "], expected [" + expectedRow.size() + "]",
dataFailures,
expected,
actualValues
);
}
} catch (AssertionError ae) {
if (logger != null && row + 1 < actualValues.size()) {
Expand All @@ -266,9 +270,7 @@ public static void assertData(
dataFailure("", dataFailures, expected, actualValues);
}
if (expectedValues.size() < actualValues.size()) {
fail(
"Elasticsearch still has data after [" + expectedValues.size() + "] entries:\n" + row(actualValues, expectedValues.size())
);
dataFailure("Elasticsearch still has data after [" + expectedValues.size() + "] entries", dataFailures, expected, actualValues);
}
}

Expand Down Expand Up @@ -303,6 +305,9 @@ private static String pipeTable(String description, List<String> headers, List<L
}
result.append('|').append(System.lineSeparator());
}
if (values.size() > maxRows) {
result.append("...").append(System.lineSeparator());
}
return result.toString();
}

Expand Down

0 comments on commit 7609278

Please sign in to comment.