Skip to content

Commit

Permalink
Merge pull request quarkusio#40235 from yrodiere/image-metrics-return
Browse files Browse the repository at this point in the history
When verifying image metrics, return all failures instead of just the first one
  • Loading branch information
yrodiere authored Apr 24, 2024
2 parents 20ed823 + 618fbbd commit fae267b
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ public void verifyImageMetrics(String propertiesFileName) {

Properties properties = getProperties(propertiesFileName);

properties.forEach((key, value) -> {
if (((String) key).endsWith(".tolerance")) {
Assertions.assertAll(properties.entrySet().stream().map(entry -> () -> {
var key = (String) entry.getKey();
var value = (String) entry.getValue();
if (key.endsWith(".tolerance")) {
return;
}
String[] keyParts = ((String) key).split("\\.");
String[] keyParts = key.split("\\.");
String tolerance = properties.getProperty(key + ".tolerance");
assert tolerance != null : "tolerance not defined for " + key;
assertValueWithinRange(Integer.parseInt((String) value), Integer.parseInt(tolerance), keyParts);
});
assertValueWithinRange(Integer.parseInt(value), Integer.parseInt(tolerance), keyParts);
}));
}

private Properties getProperties(String propertiesFileName) {
Expand Down

0 comments on commit fae267b

Please sign in to comment.